On Mon, October 24, 2011 11:44 am, Volker Bouffier wrote:
>> Even better, avoid sed altogether:
>> call append('.', map(readfile('/tmp/chosenfiles'), '"Attach: ".v:val'))
> Sed is the better choice in this case. The above command does not work
> with whitespaces.
Of course it works with whitespace. It doesn't touch anything that
is in the file.
> There must be a backslash in front of a whitespace character.
You can even do it in one step ;)
:call append('.', map(readfile('/tmp/foobar'), '"Attach:
".substitute(v:val," ",''\\ '',"g")'))
regards,
Christian