in reply to add letters to the begin of the sentence
G'day intect,
This technique should do what you want:
$ perl -Mstrict -Mwarnings -e ' my @fasta = (">dddd\n", "abcdef\n", ">eeee\n", "bcdef\n"); for (@fasta) { print "aaaa" unless /^>/; print; } ' >dddd aaaaabcdef >eeee aaaabcdef
Using your filehandles, that would be:
while (<$input_fh>) { print $output_fh 'aaaa' unless /^>/; print $output_fh $_; }
If the ACGAGTGCGT in your code is supposed to be the aaaa in your description, then just make the appropriate substitution. If it isn't, a clarification would be useful.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: add letters to the begin of the sentence
by intect (Initiate) on Sep 13, 2013 at 13:18 UTC | |
by kcott (Archbishop) on Sep 13, 2013 at 19:03 UTC |