Blog dedicated to Oracle Applications (E-Business Suite) Technology; covers Apps Architecture, Administration and third party bolt-ons to Apps

Wednesday, May 26, 2010

vi line too long error

Most of the times while viewing big log files in vi editor, you would get "Line too Long" error. A simple solution to this problem is to use the fold command:

fold -80 yourfile.log > folded.log

4 comments:

Laurent Schneider said...

:) I did not know the fold command...

Note that if vi (THE vi) does not support lines longer than 4000, some clones do support more


perl -e 'print "x" x 1000000 . "\n"' | tee long;vim long
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"long" 1 line, 1000001 characters


a 1 million character line :)

vrnb said...

hi.
typing "stty columns 130" (before invoking vi) will solve this issue.
Cheers

Anonymous said...

typing "stty columns 130" (before invoking vi) will solve this issue.


No, it won't!

prem kumar said...

I am really thankfull to you for posting this, i searched whole 5 hours for this simple solution and i couldnt find anywhere. this was really help full.

Keep posting

Thanks,
Prem