Esempio n. 1
0
        private static IList <IList <string> > ReadSynonymSets(string inputXlsFile, out int ignoredSets)
        {
            // Each line should contain a comma-separated set of terms. Lines with only one term are ignored,
            // so they can be used as headings.

            IList <IList <string> > sets = new List <IList <string> >();

            ignoredSets = 0;

            // Use the MS text ODBC driver to read the CSV file, so that commas inside the text and
            // escaped quotes are handled correctly.

            using (IDbConnection connection = ExcelDataHelper.GetOpenDbConnection(inputXlsFile,
                                                                                  ExcelDataHelper.ExcelOptions.None))
            {
                using (IDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = "SELECT * FROM [Sheet1$]";

                    using (IDataReader reader = command.ExecuteReader())
                    {
                        if (!FindStartSentinel(reader))
                        {
                            throw new ApplicationException("The input file does not contain a start marker. It"
                                                           + " must contain a row with " + listStartSentinel + " in the first column.");
                        }

                        while (reader.Read())
                        {
                            ReadSynonymRow(reader, sets, ref ignoredSets);
                        }
                    }
                }
            }

            return(sets);
        }
    private string SelectFile()
    {
        string path = EditorUtility.OpenFilePanel("Select Excel file", _ExcelDataGeneration.EXCEL_DATA_PATH, "xlsx");

        return(ExcelDataHelper.GetAppDtoName(path));
    }
 private string SelectFile()
 {
     _dataPath = EditorUtility.OpenFilePanel("Select Excel file", Application.dataPath + "/Editor/ExcelData/", "xlsx");
     return(ExcelDataHelper.GetAppDtoName(_dataPath));
 }
 /// <summary>
 /// 载入Excel数据
 /// </summary>
 private void InitDataList()
 {
     dataset = ExcelDataHelper.ReadExcel(EXCEL_DATA_PATH + EXCEL_DATA_NAME);
     column  = dataset.Tables[0].Columns.Count; //竖
     row     = dataset.Tables[0].Rows.Count;    //横
 }
 /// <summary>
 /// 载入Excel数据
 /// </summary>
 private void InitDataList()
 {
     _dataSet = ExcelDataHelper.ReadExcel(_dataPath);
     column   = _dataSet.Tables[0].Columns.Count; //竖
     row      = _dataSet.Tables[0].Rows.Count;    //横
 }