pvdung / jcsv

Automatically exported from code.google.com/p/jcsv
0 stars 0 forks source link

readHeader() doesn't parse the comma separated header fields #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call CsvReader.readHeader()
2.
3.

What is the expected output? What do you see instead?

I expect the List<String> will contain a list of headers for each comma 
separated field.  Instead it gives the entire line, unparsed.  I would have to 
write a csv parser myself to parse the header line.  Useless.

What version of the product are you using? On what operating system?

1.4.0 on JDK 1.7 on Windows 7 enterprise.

Please provide any additional information below.

Original issue reported on code.google.com by dean.w.s...@gmail.com on 2 Mar 2014 at 10:41

GoogleCodeExporter commented 9 years ago
I think this is because the default Strategy has a semi-colon as the delimiter, 
not a comma. You'll have to create a [ new Strategy(',', '"', '#', false, true) 
]. The only difference between this listed one and the default is the ; changed 
to a , which might fix the problem. Since it's looking for a ; to split the 
header and finds none, it assumes you have only 1 column overall.

Original comment by acsta...@gmail.com on 8 Dec 2014 at 7:57