Reader in = new FileReader(dataFile);
Iterable<CSVRecord> records = CSVFormat.RFC4180.withFirstRecordAsHeader().withIgnoreEmptyLines(true).withTrim().parse(in);
// Reads the data in csv file until last row is encountered
for (CSVRecord record : records) {
String column1= record.get("column1");
Here the column1 value in csv file is something like "1234557. So whe I read the column it is fetched with the quotes at the start. Is there any way in Apache commons csv to skip those.
Sample data from csv file:"""0996108562","""204979956"
If I correctly understand your requirement, you need to use unescapeCsv from Apache's StringEscapeUtils. As the doc says:
Unable to reproduce using
commons-csv-1.4.jar
with this MCVE (Minimal, Complete, and Verifiable example):Output:
The quotes around
"2"
and"Bar"
have been removed.