Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetTablePadding() appends excess pad char to data rows #226

Open
TLINDEN opened this issue Feb 29, 2024 · 0 comments
Open

SetTablePadding() appends excess pad char to data rows #226

TLINDEN opened this issue Feb 29, 2024 · 0 comments

Comments

@TLINDEN
Copy link

TLINDEN commented Feb 29, 2024

When using said option like this:

table.SetTablePadding("\t")

Then the columns are separated by TAB as whished, but the rows contain an additional TAB at the end.

# output piped to cat -t
NAME  ^IVALUE 
foo   ^Ibar  ^I
blubbi^Ibulga^I

That way it is not further processible using tools like miller:

.. | mlr -i pprint cat
mlr: mlr: CSV header/data length mismatch 2 != 3 at filename (stdin) line  2.

Here miller assumes, that the table has 2 columns as indicated by the two headers separated by 1 TAB. However, as the data columns contain two TABs, miller sees 3 data columns.

So it would be more consistent if the pad char will be appended on the headers as well or not appended anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant