today I got stuck with a new file format, and I need to give it both a header line (all my other tools want a header line) and "space,space" between the columns that are curently just space seperated.
I figured out that I could do
sed -i '/\ /s/\ / , /g' inputfile.dat
sed -i '1 \A , B , C , D' inputfile.dat
and that will work except typing "A , B , C , D , etc....." is a big pain to input the header strings to sed.
so, I wonder if I have a seperate called HeaderFile.txt or something like that that has each of the header titles, can sed read that and add it to the columns?
in psuedo-code something like
sed -i '1 \HeaderFile.txt' inputfile.dat
the HeaderFile.txt file might look someting like
string1 , string2 , string3 , string4 , etc....
or someting like
whatever is easier
thnks so much for whatever help you can give,