On Aug 6, 4:36 pm, drlatex <[email protected]> wrote:
> Hello,
>
> I have a big file, that looks someone like this:
>
>
>
> asdf....|name1|....asdf
>
> asdf....|name2|..asdf
>
> asdf....|name3|....asdfa
>
> where the ellipses (dots) represent large amounts of letters, and there are
> 500 sections separated by '>'
>
> I want, instead of this one big file, 500 smaller files that only have '>'
> once:
>
:help :write_f
something like this would work:
:.,/^>/w file1
/^>
:.,/^>/w file2
n
:.,/^>/w file3
...etc.
(completely untested, and assuming that the > to separate sections is
at the beginning of a line)
You could write a function or record a macro if you want it to loop,
possibly making use of the :exec command and incrementing a variable
to append to the end of each file name.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---