Tuesday, April 9, 2013

Re: Can I control the order of files, then concat into a file

On 2013-04-09 18:46, Russell Urquhart wrote:
> The order is probably going to be specific to what my users want,
> and not sorted by any manner.
>
> Can anyone suggest the best way to do this in Vim?

Presuming you want to control the order of the files by having them
listed one-per-line in a file, you could do something like

:g/^/exe 'sview '.getline('.')|w!>>output.txt|q

This looks at each line in your order-control file, splits to open
the file named on the line (using ":sview" so it's read-only), writes
the contents (appending) to "output.txt", then quits the split
window, leaving you back in your original order-control file.

-tim




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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: