Remove x number of lines from beginning of file

Alex Esplin alex.esplin at gmail.com
Thu Oct 25 19:54:45 MDT 2007


On 10/25/07, Alex Esplin <alex.esplin at gmail.com> wrote:
> vim test.txt
> xdd
> :wq

Just did some preliminary testing on this.  With a file of 2,347,884
lines, I dd'ed the first 299 lines and closed the file in:

time vim test.txt
299dd
:wq

real    0m15.793s
user    0m2.612s
sys     0m3.391s

If you wrote that into a vim script it would probably go faster.

with a file with 5,000,000 lines I had

time vim test.txt
3513dd
:wq

real    0m46.837s
user    0m6.163s
sys     0m7.209s

I have homework to do or I would do more testing.

-- 
Alex Esplin



More information about the PLUG mailing list