public bool UseCsvFileAnalyzer() { // 1. Creation Management Cfa = new CsvFileAnalyzer(); Cfa.FilePath = FaoFilePath; Cfa.Delimiters = new char[] { ',', ' ', '\t' }; CsvFileStructure Cfs = new CsvFileStructure(); Cfs.HeaderLineStartAt = 3; Cfs.DataLinesStartAt = 5; Cfs.FooterLinesCount = 0; Dal = new Dal_FaoFpi(); DatalineEntityAndFormat Def = new DatalineEntityAndFormat(); // 2. Dependency Management Cfa.Cfs = Cfs; Dal.Def = Def; Cfa.Dal = Dal; // 3. Read Csv File bool result = Cfa.ReadCsvFile(); // 4. Store as Csv StoreArrayAsResultCsv(Dal.DateList.ToArray(), Dal.FpiList.ToArray(), "OriginalFpi"); StoreArrayAsResultCsv(Dal.DateList.ToArray(), Dal.MpiList.ToArray(), "OriginalMpi"); StoreArrayAsResultCsv(Dal.DateList.ToArray(), Dal.DpiList.ToArray(), "OriginalDpi"); StoreArrayAsResultCsv(Dal.DateList.ToArray(), Dal.CpiList.ToArray(), "OriginalCpi"); StoreArrayAsResultCsv(Dal.DateList.ToArray(), Dal.OpiList.ToArray(), "OriginalOpi"); StoreArrayAsResultCsv(Dal.DateList.ToArray(), Dal.SpiList.ToArray(), "OriginalSpi"); return(result); }
public bool UseCsvFileAnalyzer() { bool result = true; foreach (string value in FileNames) { // 1. Creation Management Cfa = new CsvFileAnalyzer(); string sID = "TG_STAID" + value.PadLeft(6, '0'); Cfa.FilePath = @"C:\Workspace\Publications\EIA\Model\ECA_blend_tg\" + sID + ".txt"; Cfa.Delimiters = new char[] { ',', ' ' }; CsvFileStructure Cfs = new CsvFileStructure(); Cfs.HeaderLineStartAt = 21; Cfs.DataLinesStartAt = 22; Cfs.FooterLinesCount = 0; Dal = new Dal_FrTemp(); DatalineEntityAndFormat Def = new DatalineEntityAndFormat(); // 2. Dependency Management Cfa.Cfs = Cfs; Dal.Def = Def; Cfa.Dal = Dal; // 3. Read Csv File result &= Cfa.ReadCsvFile(); // TODO: Encapsulte by Class Dic_STAID_List.TryAdd(sID, Dal.STAID); Dic_SOUID_List.TryAdd(sID, Dal.SOUID); Dic_DATE_List.TryAdd(sID, Dal.DATE); Dic_TG_List.TryAdd(sID, Dal.TG); Dic_Q_TG_List.TryAdd(sID, Dal.Q_TG); // Store as Meta StoreArrayAsMetaCsv(Dal.STAID.ToArray(), Dal.DATE.ToArray(), Dal.TG.ToArray(), Dal.Q_TG.ToArray(), "RawTemp_" + sID); } return(result); }
public bool UseCsvFileAnalyzer() { // 1. Creation Management Cfa = new CsvFileAnalyzer(); Cfa.FilePath = FilePath; Cfa.Delimiters = new char[] { '\t' }; CsvFileStructure Cfs = new CsvFileStructure(); Cfs.HeaderLineStartAt = 1; Cfs.DataLinesStartAt = 2; Cfs.FooterLinesCount = 0; Dal = new Dal_EuroStatFrench(); DatalineEntityAndFormat Def = new DatalineEntityAndFormat(); // 2. Dependency Management Cfa.Cfs = Cfs; Dal.Def = Def; Cfa.Dal = Dal; // 3. Read Csv File bool result = Cfa.ReadCsvFile(); // 4. Store as Excel Efa_Dic_StringList_DoubleList_Fpi Ea = new Efa_Dic_StringList_DoubleList_Fpi(); Ea.FilePath = AppDomain.CurrentDomain.BaseDirectory + "Result\\Result_Summary\\" + "Result_Auto_Data_Original" + ".xlsx"; Ea.SheetName = "Original"; Ea.dicListDate = Dal.dicListDate; Ea.dicListFpi = Dal.dicListFpi; Ea.CreateExcel(); return(result); }