private CsvTextFieldParser CreateActualParser(string input, bool trimWhiteSpace, bool hasFieldsEnclosedInQuotes)
        {
            var parser = new CsvTextFieldParser(new StringReader(input));

            parser.CompatibilityMode         = true;
            parser.TrimWhiteSpace            = trimWhiteSpace;
            parser.HasFieldsEnclosedInQuotes = hasFieldsEnclosedInQuotes;
            return(parser);
        }
Exemple #2
0
 public IEnumerable <string[]> ParseFancyCsv(string input)
 {
     using (var parser = new CsvTextFieldParser(new StringReader(input))
     {
         HasFieldsEnclosedInQuotes = false
     })
     {
         while (!parser.EndOfData)
         {
             yield return(parser.ReadFields());
         }
     }
 }