Monday, January 14, 2013

Re: Save part from file.txt to file1.txt ?

On Monday, January 14, 2013 9:41:42 AM UTC-6, Jack Gates wrote:
> I haven't found it in help yet because I'm probably not searching correctly.
>
>
>
> I want save the yanked text from one large file and save it to another
>
> file. I can do this manually with no problem but how to do it
>
> automated has escaped me so far.
>
>
>
> I want to generate file1.txt, file2.txt, file3.txt from file.txt with a mapping.
>
>
>
> I open file.txt yank "a50Y another "b50Y another "c50Y
>
>
>
> :tabnew 3 times paste a, b, c into the 3 files.
>
>
>
> Now I have 4 files open and 3 not saved. How to tell Vim to save and
>
> name them file1.txt file2.txt file3.txt
>
>
>
> Will someone point me to the correct help file please.

Look through :help :write and :help :write_f for the various ways to write output to a file.

For example,

:7,42w >> blah.txt

Will append lines 7-42 of the current file to the end of existing other file blah.txt.

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