I want to get an ID from a line across several files, then add some info, before and after this using sed- I don't want to use anything else. e.g The original line looks like:
19F_4414_2.aln:>tai19F_14 Taiwan19F_14
I want to print:
pathfind -t lane -id tai19F_14 -f fastq -l .
So far I have:
grep ">" 19F_4414*.aln | sed -e 's/^.*>/pathfind -t lane -id /1; s/ .*//5'
The first substitution works, but the second part doesn't. If I add the asterisk it won't replace the end of the line, but the single full stop only replaces one letter. If you could let me know why, and how to fix this.
I would try it like this
sed 's/.*aln:>\(\S*\).*/pathfind -t lane -id \1 -f fastq -l/g'