-
Notifications
You must be signed in to change notification settings - Fork 166
Allow unescaped commas in "last" field #193
Comments
This is very similar to the last issue #192 opened 2 or 3 days ago. What do you think? |
I don't think they are the same. The other one is about properly escaping commas and quotes, where as mine is a feature request to enable csv-parse to be used with ASS files and work fine with unescaped quotes and commas as long as they are in the "Last Field". It's probably not worth putting a lot of effort into this feature request though because I don't know of any other formats which allow unescaped commas and quotes in the last field of otherwise csv compatible files. |
The subject is different but the solution I propose at the end seems similar, no? |
Closing due to lack of activity. |
This would be nice |
I have a working implementation of this feature, it need more testing but it seems to work. I will only release it at one condition, to find a better name than |
Some formats which claim to be partially compatible with csv formats like ASS assume that it's ok to have unescaped commas in the last field because the number of fields was registered when the header line was parsed.
You can see this in the ASS specification
and here
To be able to parse files like this, assuming you've already separated the data into "Chunks", it would be useful to have a flag which assumes any comma in the last field according to the number of fields calculated from the header row are escaped.
I couldn't find any options to do this in the documentation, but if I set the "relax_column_count" to true, it almost adds on post unescaped final field content as extra "default" columns, but isn't ideal, and seems to remove some of the text.
parsed with
returns
Ideally parsing the same csv with
would return
just to make it work with frustratingly close attempts at csv formats.
The text was updated successfully, but these errors were encountered: