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
So, some CSVs have newlines embedded inside quoted strings. They are parsed correctly, but totally mangle the output of print_table. It seems there are two options for dealing with this:
Render the newlines as literal \n text, or more nicely as one of ⏎, , ␍, ␊, etc.
Potentially generate multiple lines of output per row, with horizontal dividers between each row. This could be done only after embedded newlines were encountered.
I've decided to take a stab at #2, which works ideally for my purposes. It probably needs more options, like the maximum number of lines per row, or whether to use a different divider (e.g. =) to separate the header from the rest of the rows. I'll open a pull request for my quick and dirty version in case anybody is interested in pursuing this.
The text was updated successfully, but these errors were encountered:
sethk
added a commit
to sethk/agate
that referenced
this issue
Nov 6, 2020
Having tested it again, I think the dividers are maybe not desirable. For example, in files with very few problematic newlines, those dividers will significantly increase the size of the output, and worsen readability.
So, option (1) is preferred.
Test data:
a,b,c
1,2,3
"Once upon
a time",5,6
1,2,3
1,2,3
1,2,3
So, some CSVs have newlines embedded inside quoted strings. They are parsed correctly, but totally mangle the output of
print_table
. It seems there are two options for dealing with this:\n
text, or more nicely as one of ⏎, , ␍, ␊, etc.I've decided to take a stab at #2, which works ideally for my purposes. It probably needs more options, like the maximum number of lines per row, or whether to use a different divider (e.g. =) to separate the header from the rest of the rows. I'll open a pull request for my quick and dirty version in case anybody is interested in pursuing this.
The text was updated successfully, but these errors were encountered: