stefaraujo / jcsv

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

Default to comma delimeter #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
All the examples assume a semicolon delimeter, but CSV (Comma Separated Value) 
most often uses commas. Is there an option to use a specific delimiter when 
parsing a file?

Original issue reported on code.google.com by apenneba...@42six.com on 17 Dec 2013 at 7:21

GoogleCodeExporter commented 8 years ago
any update for this question please?

Original comment by phuongng...@gmail.com on 19 Aug 2014 at 12:53

GoogleCodeExporter commented 8 years ago
Not sure if this question has been answered, but after looking at the source 
code, the way to force the comma delimiter to be used instead of a semi colon 
is to create a CSVReader as follows:

CSVReader<String[]> csvParser = new 
CSVReaderBuilder<String[]>(reader).entryParser(new 
DefaultCSVEntryParser()).strategy(CSVStrategy.UK_DEFAULT).build();

(this is one line of code).   Note that the strategy is set to UK_DEFAULT, 
which uses commas as the seperator.

Original comment by otten.h...@gmail.com on 20 Jan 2015 at 7:05