jtablesaw / tablesaw

Java dataframe and visualization library
https://jtablesaw.github.io/tablesaw/
Apache License 2.0
3.55k stars 644 forks source link

Quoted comma throwing off parser? #1242

Open yfarjoun opened 1 year ago

yfarjoun commented 1 year ago

Is there no support for quoted strings?

I have a quoted string that includes a comma in it, and it seems to throw off the parser as it reads the comma as a column separator. Am I doing something wrong or is there currently no way of reading a table that has (quoted) commas in it?

Thanks!

ccleva commented 11 months ago

Hi @yfarjoun. There is support for quoted strings by default. Reading this csv file

col1,col2,col3
1,"test",test
2,"test, test",test2

with default options produces

 col1  |     col2     |  col3   |
---------------------------------
    1  |        test  |   test  |
    2  |  test, test  |  test2  |

If you are using a different quote character you can configure it in the CsvReadOptions (through the Builder)