Read() public method

public Read ( string name ) : DataSheet
name string
return DataSheet
Example #1
0
        public override void Execute()
        {
            Log.Info("Start to export excel to json...");

            using (var reader = new ExcelOperation.ExcelReader(ExcelPath, ExcelTitleRow, ExcelContentRow))
            {
                var sheets = new List<DataSheet>();
                foreach (var sheetName in ExcelSheetNames)
                {
                    Log.Info("Read sheet: {0}", sheetName);
                    sheets.Add(reader.Read(sheetName));
                }

                Log.Info("Write sheets to: {0}", JsonPath);
                File.WriteAllText(JsonPath, JsonOperation.SerializeSheets(sheets), Encoding.UTF8);
            }

            Log.Info("Done.");
        }
Example #2
0
        public override void Execute()
        {
            Log.Info("Start to export excel to json...");

            using (var reader = new ExcelOperation.ExcelReader(ExcelPath, ExcelTitleRow, ExcelContentRow))
            {
                var sheets = new List <DataSheet>();
                foreach (var sheetName in ExcelSheetNames)
                {
                    Log.Info("Read sheet: {0}", sheetName);
                    sheets.Add(reader.Read(sheetName));
                }

                Log.Info("Write sheets to: {0}", JsonPath);
                File.WriteAllText(JsonPath, JsonOperation.SerializeSheets(sheets), Encoding.UTF8);
            }

            Log.Info("Done.");
        }