janisdd / vscode-edit-csv

vs code extension to edit csv files with an excel like table ui
MIT License
211 stars 30 forks source link

Can not read cells such as "("5")" #148

Closed CGandGameEngineLearner closed 5 months ago

CGandGameEngineLearner commented 5 months ago

What OS?

Description

can not read cells such as "("5")",but i can open it by LibreOffice

if there is a

A,B,C
a1,b1,c1
a,b,"("5")"

Expected behavior

image

but in LibreOffice can read it correctly image can you identify string by ""?

CGandGameEngineLearner commented 5 months ago

image Rainbow CSV can read it correctly,too

janisdd commented 5 months ago

I have to look into this but

A,B,C
a1,b1,c1
a,b,"(""5"")"

is correct and works.

The "..." is used to enclose a field in quotation marks, it allows it to contain the delimiter ,. However, if you want a field that is already quoted to contain " itself, you must use the delimiter twice, i.e. "", to escape the quotation marks.

You can read https://www.ietf.org/rfc/rfc4180.txt page 2

7.  If double-quotes are used to enclose fields, then a double-quote
       appearing inside a field must be escaped by preceding it with
       another double quote.  For example:

 "aaa","b""bb","ccc"

This extension uses papaparse.js for parsing and largely adheres to the csv "standard" (with a few tolerances).

janisdd commented 5 months ago

I'm going to close this. I want to stay with rfc. Sorry.