Computing.Net > Forums > Unix > unix vi editor

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

unix vi editor

Reply to Message Icon

Name: indika_cha
Date: March 21, 2005 at 23:03:37 Pacific
OS: windows xp
CPU/Ram: cyrex pro 96Mb
Comment:

I have a very large text file.
I tried to edit it using vi editor - unix
when i give " vi abc.txt "
it displays the file but at the last line it says "Line too long"
And i found that it cannot display the whole file. Only the upper part it display.

My friend, if you possible please help me.

Thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: Dlonra
Date: March 22, 2005 at 13:48:58 Pacific
Reply:

is your OS is "windows xp" what vi are you using?


0

Response Number 2
Name: gurubit
Date: March 23, 2005 at 03:00:09 Pacific
Reply:

vi editor has a limitation of the number of characters in a line. If the line exceeds that, it will see the error message as "Line Too Long".

You can use cat command to open the file.
Changing the file contents of such file is a bit difficult.


0

Response Number 3
Name: Jim Boothe
Date: March 23, 2005 at 07:10:55 Pacific
Reply:

sed can probably handle the long lines. To test this, pass the file through sed:

sed s/x/x/ filein > fileout

If you can identify your various:

oldpattern1 > newpattern1
oldpattern2 > newpattern2
etc

then this forum can help with a solution.


0

Response Number 4
Name: Dlonra
Date: March 23, 2005 at 07:32:19 Pacific
Reply:

my recollection is that for non-Linux, the line length restriction applies to multiple utilities.

If a line is too long for vi, it will probably be too long for sed.


0

Response Number 5
Name: Jim Boothe
Date: March 23, 2005 at 10:50:59 Pacific
Reply:

No, I have found sed to handle very long lines, which is why I recommended it as a possible solution.

Other commands can also handle the longer lines such as wc and diff, to name a couple.


0

Related Posts

See More



Response Number 6
Name: Dlonra
Date: March 23, 2005 at 11:46:25 Pacific
Reply:

Jim,
As I tried to note, the Linux flavored utilities have no or very long line length restrictions.

my original post almost said:
'if your OS is "windows xp" what vi are you using?'

r u sure your *nix utilities (ed, ex, vi ,sed, diff, etc.) are of the same flavor as chamil?



0

Response Number 7
Name: Jim Boothe
Date: March 23, 2005 at 13:02:16 Pacific
Reply:

No, different platform. I could not say for sure, which is why I said that sed can PROBABLY handle the long lines.

You stated that, for non-Linux, if a line is too long for vi, it will probably be too long for sed.

But I do not find that correct for at least one non-Linux platform. On HP-UX, awk can handle lines up to about 2400 characters, and vi up to about 3000 characters I think, while sed can handle lines much longer than that.


0

Response Number 8
Name: Fooser
Date: April 27, 2005 at 06:34:24 Pacific
Reply:

vi is limited at 4096 (sol.8) char per line. use command fold -w 4095 file > file.new to wrap the lines.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: unix vi editor

delete blank line thro vi editor www.computing.net/answers/unix/delete-blank-line-thro-vi-editor/4552.html

Vi Editor help... www.computing.net/answers/unix/vi-editor-help/6709.html

Opening large log files in unix www.computing.net/answers/unix/opening-large-log-files-in-unix-/6035.html