-
Notifications
You must be signed in to change notification settings - Fork 52
Fields starting with equals (=
) do not open correctly in Excel
#103
Comments
Update: I found a related issue that references this page which suggests this is a problem if a field starts with So my updated workaround would be:
|
In your exemple above, you could delegate the escape work to the library: cast: {
string: s => {value: s, quoted: s.match(/^[=+\-@]/) },
} |
This being said, we could introduce a new option, |
Just quoting is not enough. I think Excel first takes the value and parses, i.e. if it's quoted it unquotes, otherwise it takes the original value. Then it says "ok does this start with an equals sign? if so it's a formula let me evaluate it". I'm not sure what happens if you try to open in Google spreadsheets--it may just be an Excel problem in which case I'd suggest calling it "excelSafe". |
I don't have excell on my host but with libreoffice, |
PapaParse has this option as (Also related to #69) |
Is someone interested in proposing a pull request ? |
If a field value starts with equals character (
=
), the csv does not open correctly in Excel. This may technically be an Excel problem, but it would be nice if there was some kind of "excelSafe" option to csv-stringify.Examples:
Workaround:
The text was updated successfully, but these errors were encountered: