Exemple #1
0
        public LogiNextDriverSummary ParseLogiNextCSV(string filePath)
        {
            LogiNextDriverSummary lnDriverSummary = new LogiNextDriverSummary();

            Regex csvParserRegex = new Regex(",(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))");

            List <string[]> fileContents = ReaderCSV.GetFileContents(filePath);

            List <LogiNextTransaction> tempTransactions = new List <LogiNextTransaction>();


            foreach (string[] csvLine in fileContents)
            {
                //string[] csvFields = csvParserRegex.Split(csvLine);
                tempTransactions.Add(new LogiNextTransaction(csvLine));
            }

            foreach (LogiNextTransaction transaction in tempTransactions)
            {
                lnDriverSummary.AddTransaction(transaction);
            }

            return(lnDriverSummary);
        }