Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

CSVReader Ignores specified delimiter #538

Closed
PaulARoy opened this issue Apr 11, 2017 · 3 comments
Closed

CSVReader Ignores specified delimiter #538

PaulARoy opened this issue Apr 11, 2017 · 3 comments

Comments

@PaulARoy
Copy link
Contributor

Hi there!

First of all thanks for your awesome library.
I noticed that CSVReader completely ignores the delimiter (when specified on constructor) when we use ToMatrix() or ToTable().

This is due to ReadField() forcing a GuessDelimiterFromBuffer() on initialization: 
https://github.com/accord-net/framework/blob/development/Sources/Accord.IO/Csv/CsvReader.cs#L1090
https://github.com/accord-net/framework/blob/development/Sources/Accord.IO/Csv/CsvReader.cs#L1126

This GuessDelimiterFromBuffer() should not happen if delimiter was specified from constructor.

We noticed the issue because in french the double parser expects 0,12 (instead of 0.12), but reading the matrix 0,12;0,13 separates the entries according to ',' instead of specified ';'

I can make a PR on this issue if needed.

@cesarsouza
Copy link
Member

Hi Paul,

Thanks a lot for reporting the issue! Indeed, if you could make a PR it would be really great!

If you need further help, please ask. By the way, I also live in Grenoble, it is nice to see the framework being used so close from home :-)

Cesar

@PaulARoy
Copy link
Contributor Author

A small world after all :)
It should not be an issue to make this PR, the solution is fairly simple.

It could be nice to meet!

PaulARoy added a commit to PaulARoy/framework that referenced this issue Apr 14, 2017
cesarsouza added a commit that referenced this issue Apr 14, 2017
Fixing #538: CSVReader Ignores specified delimiter
@cesarsouza
Copy link
Member

Added in release 3.6.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants