static void Main(string[] args) { CsvInterface csvInput = new CsvInterface(); csvInput.LoadCVSData(); WebhookInterface.SendDataListToWebhook(csvInput.csvData); }
public static void Main(string[] args) { string inputFile = "test.csv"; string outputFile = "output.csv"; // // read-in file // CsvInterface csvIn = new CsvInterface(); List <CsvRow> list = csvIn.CsvToList(inputFile); // // calculate and output results // // Output the total number of records in the file. int totalRecords = GetTotalRecordCount(list); Console.WriteLine("Total number of records:\t" + totalRecords); // Show the largest sum of Val1 and Val2 for any single row in the CSV, as well as the GUID for that row. int index = GetLargestVal1andVal2comboRow(list) - 1; Console.WriteLine("Row with largest val1+val2 value:\tGUID=" + list[index].GUID + "\tval1+val2=" + (Int32.Parse(list[index].val1) + Int32.Parse(list[index].val2))); // Show any Duplicate GUID values. List <CsvRow> dupGuidRows = GetDuplicateGuidRows(list); foreach (string s in GetDuplicateGuidList(dupGuidRows)) { Console.WriteLine(s); } // Show the average length of Val3 across all input rows. float averageLength = GetAverageVal3length(list); Console.WriteLine("Average Val3 length:\t" + averageLength); // output file CsvInterface csvOut = new CsvInterface(); csvOut.csvList = GenerateOutputFileData(list, dupGuidRows, averageLength); csvOut.OutputCsvFile(outputFile); } //