(GNU sed version 4.0.7 - compiled for Win32 - from http://unxutils.sourceforge.net)
To prepend one single line on top of a large txt file, the following single line batch script works fine:
gsed -i "1i longheader1 longheader2 longheader3 longheader4 ..." testfile.txt
However, for clarity's sake, it would be useful to format the batch script with the literal string split over several lines, possibly so:
gsed -i "1i ^
longheader1 ^
longheader2 ^
longheader3 ^
longheader4" ^
testfile.txt
Unfortunately, executing the above batch script fails with :
'longheader1' is not recognized as an internal or external command, operable program or batch file.
Replacing line-continuation character ^
by \
also fails.
Any suggestion as to why the 'line-continuation" script fails, and potential concise workaround ?
__philippe