| Issue 10: | Default to comma delimeter | |
| 2 people starred this issue and may be notified of changes. | Back to list |
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?
Aug 19, 2014
#1
phuongng...@gmail.com
Jan 20, 2015
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. |