Computing.Net > Forums > Unix > vi command

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.

vi command

Reply to Message Icon

Name: htnkd
Date: November 1, 2004 at 09:10:46 Pacific
OS: xp
CPU/Ram: 650
Comment:

I have a file that is close to a 2Gig file-- need to perform a vi on it so I can manually edit it .

getting an error when I do a vi on the file

tmp file too large--

how can I open a file so I can see what I need to change-- sed will not work for what I need to do.

thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: November 1, 2004 at 10:04:45 Pacific
Reply:

How about using 'split' to split the file into pieces, edit what is necessary and then use 'join' or 'cat' to put the pieces back together.


0

Response Number 2
Name: thepubba
Date: November 1, 2004 at 14:20:47 Pacific
Reply:

If you have a filesystem that has sufficient room to open a 2 gig file, then do the following:

vi

From the colon prompt, type:

:set directory=/bighonkingfilesystem

To see which directory is currently set in vi, type:

:set directory

To see everything, type:

:set all

:r <bigfile>

Otherwise, you'll have to figure out how to split it like Don has suggested.

By default, the vi editor uses /var/tmp, which on most unix installations is significantly smaller than 2 gig. I've never tried to open a 2 gig file with vi so even if your temp directory is big enough, perhaps vi will still fail (although I would assume you will get a different error).


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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: vi command

cygnus/cygwin/bash/vi editor proble www.computing.net/answers/unix/cygnuscygwinbashvi-editor-proble/4536.html

Zsh as login shell, and shell in VI www.computing.net/answers/unix/zsh-as-login-shell-and-shell-in-vi/5785.html

Unix VI help www.computing.net/answers/unix/unix-vi-help/5609.html