[plug] Extreme text editing

James Devenish devenish at guild.uwa.edu.au
Tue Oct 7 22:46:19 WST 2003


In message <200310072152.59766.mike at gilks1.com>
on Tue, Oct 07, 2003 at 09:52:59PM +0800, J Michael Gilks wrote:
> unfortunately had an error on line 10,557,152.
> The total file was 4.3GB on a remote NFS partition and contained 66,709,648 

Someone will now sing praises of VMS or some such.

> I eventually opened the file with VI navigated to line 10,557,152, 
[...]
> Does anyone have any ideas about how this could be done without
> loading the entire file.

One thing about vi: disable the creation of a swap file. One thing about
anything: if you need to seek to a particular line, then without an
index of the file contents it will be necessary for any programme to
read the entire file in order to find any specific line. Thus, it will
be as slow as the disk. But if you can narrow the problem down to a
smaller byte range (e.g. 100Mb) then you stand an okay chance. You
should be able to use `dd` to output regions of files. You could then
view the small regions with `less` and invoke `vi` from within less when
you find the affected area. Once you have finished editing, use dd to
write the second file back into the middle of the first file. I wonder
whether SGI has anything to deal with working with the middle of large
files.


_______________________________________________
plug mailing list
plug at plug.linux.org.au
http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug


More information about the plug mailing list