Hi Tim,

somehow my email was partially deleted... ??


    cat file | vim -

What stands the "-" for?


Then, clean up the stuff we don't want

    1,/received/d
    $?^\s*For subscribe options?,$d

to strip off the header and footer.

this worked out nicely


My first-pass solution will end up with duplicate results if
  more than one of your keywords appear in the same "block"
but on diff. lines:

    :let @a=''
    :g/red\|relativistic/?^\s*astro-ph?,/^\s*astro-ph/-y A
    :%d
    :put a
    :1d
    :wq name_of_output.txt

this is the content of foo.vim? On separated lines? I also tried with
CTRL + V + ENTER at the end of each line, but the result was the
same...




    cat input.txt | vim -s foo.vim -

when I run it I end up with an empty file... ?




I'm sorry I couldn't come up with a clean way to snag just
the unique paragraphs easily without having an instance show
up as its own result-block.

I was saying in my deleted email that in any case it's a nice
lesson... When I think that people here think I know vim... what a
shame!


Anyways, it's at least one sorta-solution to what you describe.

-tim





Reply via email to