Thursday, November 8, 2012

Re: change all files

How about

1) Concatenate and sort all the files, either outside vim and load them into vim, or in, say

:for x in expand('file*',0,1) | exe 'r ' . x | endfor | sort

2) Decorate those of interest, say

:%s/^\(\(.\{-}\),.*\)\n\(\2,.*\)$/\1@!@\r\3@!@/

3) Delete the uninteresting:

:v/@!@/d

4) Remove the decorations:

:%s/@!@//

Steps 2,3,4 could be combined using a look behind regex, I imagine.

Regards, John

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