Computing.Net > Forums > Unix > vi command

vi command

Reply to Message Icon

Original Message
Name: htnkd
Date: November 1, 2004 at 09:10:46 Pacific
Subject: vi command
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


Report Offensive Message For Removal


Response Number 1
Name: Don Arnett
Date: November 1, 2004 at 10:04:45 Pacific
Subject: vi command
Reply: (edit)

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.


Report Offensive Follow Up For Removal

Response Number 2
Name: thepubba
Date: November 1, 2004 at 14:20:47 Pacific
Subject: vi command
Reply: (edit)

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).


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: vi command

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge