close2 / csv

A dart csv to list codec / converter
MIT License
98 stars 24 forks source link

The numbers or time contain "\" #51

Closed kevinxxq closed 2 years ago

kevinxxq commented 2 years ago

Hi There, Thank you for the package. I tried to parse some csv file, but looks like there are something not working well.The numbers or timedate are deliminated with "\":

image

the code:

 // Read the file
    final strFile = await file.readAsString(
      encoding: systemEncoding,
    );

    List<List<dynamic>> listLines = const CsvToListConverter(
      eol: "\n",
      fieldDelimiter: ",",
      shouldParseNumbers: false,
    ).convert(strFile);

The data in csv file:

"Measurement position,,,50,150"
"Time stamp,2014-05-15,,14:21:25,14:21:25"

Thank you.

close2 commented 2 years ago

I am not sure I understand the problem.

Is the problem that the CsvToListConverter splits the second line, even though it has a quote (") at the beginning and end of the line? That would indeed be a bug.

close2 commented 2 years ago

I have taken another look at your screenshot. I find it strange that Time stamp is offset by half a character. Is it possible that you CSV file contains some strange unicode character instead of a simple "?

Closing for now.