in reply to Adding characters to the beginning of a file

Perl of course has a one liner for this using the inplace edit feature. This does the trick (and writes a backup file of the original with a .bak appended just in case :-)

perl -pi.bak -e '$begin++ || s/^/>/' dna.txt

This does what you have to do. Read the file in and write out a new modified file. You need to use " instead of ' on Win32.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print