5

I'm trying to view the first 5 columns from the terminal following this guide here: https://chrisjean.com/view-csv-data-from-the-command-line/

When I run

cat rangelast.csv | sed -e 's/,,/, ,/g' | column -s, -t | less -#5 -N -S 

I get this error:

column: line too long

How can I solve it?

1
  • with column, always also make sure that ALL LINES (especially the final line) end in a newline. You will see the line too long (even on a short line) if the final line does not terminate with \n Nov 4, 2019 at 22:45

1 Answer 1

5

According to this bug report

In the utility source code: column.c It defines MAXLINELEN as 2048 + 1

If your input contains a line which its length is > 2048 you'll get this error.

In order to solve it, you should make sure that the length of the lines in your input is < 2048, or replace the 'column' utility with another one.

3
  • 1
    what 'column' utility should i use ? Jun 24, 2018 at 6:24
  • @QassamMahmoud - this is another question, if you like, you can open a new question, define your input, the desired manipulation on the input/expected output. and asked for help.
    – Yaron
    Jun 24, 2018 at 6:30
  • @QassamMahmoud if the task is important enough... you can get the source and build from source and just change the constant value from 2048 to 2,4,8,16,32 times the size. Apr 12, 2019 at 15:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .