Thursday, June 7, 2012

Re: An easier way to top & tail 4GB [Was: What is the largest file I can edit using vim?]

On Thu, Jun 7, 2012 at 7:30 AM, Erik Christiansen
<dvalin@internode.on.net> wrote:
> On 07.06.12 08:56, james pruett wrote:
>> I have an *.sql file.
>> Typically I chop it, but I am tired of chopping it.
>> I want to remove the first 10 lines and the last 10 lines of this 4GB file.

I'm not sure what you mean by chopping it, or why it would be
tiresome. There are utilities for such things, like split(1).

> $ tail --lines=+11 fred.sql | head --lines=-10
>
> (Tested with /etc/passwd, it cuts at the right line numbers, as far as I
> can see.)

Also a skillful technique.

--
Kevin O'Gorman, PhD

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: