Thursday, June 7, 2012

Re: What is the largest file I can edit using vim?

On Thu, 2012-06-07 at 19:42 +0530, Amit Agarwal wrote:
> You can possibly use sed to do that.

from the sed one liners page http://sed.sourceforge.net/sed1line.txt

# delete the first 10 lines of a file
sed '1,10d'

# delete the last line of a file
sed '$d'

# delete the last 2 lines of a file
sed 'N;$!P;$!D;$d'

# delete the last 10 lines of a file
sed -e :a -e '$d;N;2,10ba' -e 'P;D' # method 1
sed -n -e :a -e '1,10!{P;N;D;};N;ba' # method 2

--
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: