On 17:23 Thu 08 Nov     , vicky b wrote:
> THanks Tim dont get me wrong on this i have another query hope u wont mind,
> 
>   now i have 4 file where each file has key,value data , now i want to
> compare all the files get all the lines which have common keys in it , say
> 
>  file1            file2                     file3           file
> tim,chase    tom,someting    tom,wright   chase,w
> tom,jerry      vinay,b              sachin,b      tom,m
> 
> out put would be
> tom,chase
> tom,jerry
> tom,wright
> tom,m
> 
> 
> is this  possible in vim

Hi,

I guess you can use the :g command (":help :g"):

:argdo :g/^tom/#

:argdo  - do the command for every file in the arg list
:g      - run the # command (:help :#) for every line matching the pattern 
between /.../

If you want to put the output into another buffer you can do redirect it
to a register and paste it somewhere:

:redir @a
:argdo :g/^tom/
:redir end

Now you can paste the output using: "ap in normal mode.

If there is no command specified for the :g command it just prints the
line (:# prints the line with the line number).

Best,
Marcin

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

Reply via email to