Inserting a String in a file header.

Dear all,

            I have a file created in the name sample.txt in UNIX with header and footer. How to insert a required string \(for example "FILE1"\) in the header part after the file has been created. What kind of command can i use to do the same.

Thanks in advance
Hari

man sed

sed '1 s/$/FILE1\n/' file

Can we include spaces in that sed command??

Thanks
hari

Try it, and be amazed.