You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm calling parse with {raw: true} to get the original line. When lines end in just "\n", things work fine. When lines end in "\r\n", the raw output is missing the final "\n".
Third output: In addition to the missing "\n" in the first raw, the 'd\n' cell value is surprising! Mixed line endings are tricky, so maybe there's no 100% correct answer here. But mixed line endings do come up in practice, and I think this might be better:
My higher-level goal: I'm trying to add a column of cells to an existing CSV. I'd like to avoid modifying the format of any of the existing cells, since subtle changes in quoting can change how tools like Excel interpret a CSV. I was hoping the {raw: true} option would give me a way to do that, but I ran into this issue.
The text was updated successfully, but these errors were encountered:
cakoose
changed the title
parse with {raw: true} and windows line endings (aka CRLF, "\r\nparse with {raw: true} and windows line endings loses the newline
Apr 5, 2022
Describe the bug
I'm calling
parse
with{raw: true}
to get the original line. When lines end in just "\n", things work fine. When lines end in "\r\n", the raw output is missing the final "\n".To Reproduce
Output:
First output: correct.
Second output: the
raw
fields are missing "\n" at the end. What I'd expect:Third output: In addition to the missing "\n" in the first
raw
, the'd\n'
cell value is surprising! Mixed line endings are tricky, so maybe there's no 100% correct answer here. But mixed line endings do come up in practice, and I think this might be better:Additional context
My higher-level goal: I'm trying to add a column of cells to an existing CSV. I'd like to avoid modifying the format of any of the existing cells, since subtle changes in quoting can change how tools like Excel interpret a CSV. I was hoping the
{raw: true}
option would give me a way to do that, but I ran into this issue.The text was updated successfully, but these errors were encountered: