September 13th, 2004, 12:11 AM
file too long error
I am new to Unix
I have been opening files in vi editor by command:
But for certain files while using this command following error is displayed:
File too long
Can anyone help me how to fix this error.
Thanks in Advance
September 13th, 2004, 05:02 AM
I'm no expert with vi but have found the following at URL
I don't know if it is possible to get round this particular limitation or even if the note is up to date, but it would make sense that there would be an upper limit on the size of file you can open for editing.
If you just wanting to read the contents of the file then obviously commands pg, more, less, tail, and head can help.
If you want to edit the file and the changes are small enough then "sed" might be a better tool. Otherwise, I'd probably split the file somehow and edit the chunks before putting it back together.
Hmmm.... I'm interested if anyone has any other tips.
Hope this helps until then.
September 13th, 2004, 09:23 AM
What O/S are you on? That is, Solaris, AIX, HP/UX, Linux, etc? Additionally, how big is the file you're trying to edit. You can do an ls -l on the file to see how big it is.
This sounds like it is an older O/S but the reality is that you simply may not be able to edit a file as big as you're trying to edit.
September 14th, 2004, 11:27 AM
Originally Posted by Rohit Sharma
Basically, the file you are trying to view is unwrapped from the editors point of view. It doesn't contain any valid wrapping character.
My advice is to look around for a utility or script that will wrap the file at something like 80 bytes or so ( or one that will allow you to specify the wrap length ). Either way, that is what is quite possibly wrong.
September 14th, 2004, 11:53 PM
note the diff:
a) line too long
b) file too long
also vi knows limits
in case a the line is >1024 chars
in case b the file is big, very big
split it, edit and cat