Closed karaabova closed 6 years ago
Hi @karaabova,
Thanks for taking the time to describe your issue in detail, that makes it a lot easier for me to help.
The reason you're having problems is that "
is the default quote char and is intended to surround everything between a separator and either another separator or the beginning/end of a line. You can simply change quote char to some other character that you aren't using.
This would work:
def data = parseCsv(new FileReader(new File("tmp.csv")), separator: ';', quoteChar: ':')
for(line in data) {
println "$line"
}
If you're in control of how the csv is being generated another option might be to escape the quotes ( \"
).
Hope this helps. Cheers!
Hello,
I faced an issue, when trying to parse a file with a line that ends with quotes. The parser doesn't read the ending quote, but if I add a char or space after the ending quote (line 1, from the file, ends with space), it is fine.
Let me share an example, a file with the following content:
id;test 1;project = "Test 1" 2;project = "Test 2"
Code:
Output: