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
If you have a csv with multi-line strings and want to pretty print it, the rendering
is not what is expected.
For example
some,example,here
string1,"multiline
string",string2
more, text,"here
it overflows"
more,data,here
gets shown as
$ cat test2.csv | csvtk pretty -S grid
+---------+------------------+-------------+
| some | example | here |
+=========+==================+=============+
| string1 | multiline
string | string2 |
+---------+------------------+-------------+
| more | text | here
it overflows |
+---------+------------------+-------------+
| more | data | here |
+---------+------------------+-------------+
whereas I think the multi-line text should be rendered within their respective column (like in excel and csvlens).
Here is kinda what I would expect it to look like (except the padding is a bit off):
+---------+------------------+-------------+
| some | example | here |
+=========+==================+=============+
| string1 | multiline | string2 |
| | string | |
+---------+------------------+-------------+
| more | text | here |
| | | it overflows|
+---------+------------------+-------------+
| more | data | here |
+---------+------------------+-------------+
This is tested with the default, plain and grid format, but I suspect it applies to all formats.
The text was updated successfully, but these errors were encountered:
MarcCoquand
changed the title
Multi line strings are not rendered properly
Multi line strings are not pretty-printed properly
Aug 10, 2024
$ cat test2.csv | csvtk pretty -S grid
+---------+------------------+-------------------+
| some | example | here |
+=========+==================+===================+
| string1 | multiline string | string2 |
+---------+------------------+-------------------+
| more | text | here it overflows |
+---------+------------------+-------------------+
| more | data | here |
+---------+------------------+-------------------+
And you can set the max and min width for each column.
$ cat test2.csv | csvtk pretty -S grid -w 10 -W 0,15,15
+------------+-----------------+-----------------+
| some | example | here |
+============+=================+=================+
| string1 | multiline | string2 |
| | string | |
+------------+-----------------+-----------------+
| more | text | here it |
| | | overflows |
+------------+-----------------+-----------------+
| more | data | here |
+------------+-----------------+-----------------+
Prerequisites
csvtk version
Version is 0.30
Describe your issue
If you have a csv with multi-line strings and want to pretty print it, the rendering
is not what is expected.
For example
gets shown as
whereas I think the multi-line text should be rendered within their respective column (like in excel and csvlens).
Here is kinda what I would expect it to look like (except the padding is a bit off):
This is tested with the default, plain and grid format, but I suspect it applies to all formats.
The text was updated successfully, but these errors were encountered: