I have a file with data extracted, and need to insert a header with a constant string, say: H|PayerDataExtract
if i use
sed, i have to redirect the output to a seperate file like
sed '
sed commands' ExtractDataFile.dat > ExtractDataFileWithHeader.dat
the same is true for awk
and in its simplist form i could say
echo 'H|PayerDataExtract' > ExtractDataFileWithHeader.dat
cat ExtractDataFile.dat >> ExtractDataFileWithHeader.dat
mv ExtractDataFileWithHeader.dat ExtractDataFile.dat
but in all of the above an extra file is created. If i were to do this in
vi manually the extra file could be avoided.
Is there a way to avoid the extra file while still not having to manually use
vi in a interactive manner? This is even more neccessary if the file uses over 50% filespace and an extra file will just double my usage , though temporarily