According to Justin Wilson: While burning my CPU.
>
> I have a large file (400+ megs) and I do not want to vi the file and
> cause the server load to shoot up. What I do want to do is "cut off" the 1st
> 2,000 lines or so. Can I do this without actually opening up the file?
'head -n xxx' might help you here.
'sed' would allow you to search and replace words or lines from the file.
For example;
sed 's/\#.*$//g' file1 >file2
sed will search for a "# mark" at the beginning of a line and remove the
whole line.
But of course if the file is 400M thats going to take up quite a lot of
resources.
I dont use VI myself, however i seem to remember someone explaning about a
command line option for VI which would only open so many lines of a file,
now as to the correctness of that statement i did say, "i seem to remember"
meaning i'n not sure. Maybe someone else can help on that.
>
> Justin
>
> --------------
> Justin Wilson
> [EMAIL PROTECTED]
> http://jsw.tctc.com ICQ#:3336804
>
--
Regards Richard.
[EMAIL PROTECTED]