I have a fastq file and i need to edit its header as needed by trinity. My headers are like this :
In the above headers the Bold text keeps on changing with each header other text remains same. Now i want all header to be replace in one go with a pattern that results in the following headers:
@MexD1SRR1561197.1/1
@MexD1SRR1561197.2/1
@MexD1SRR1561197.3/1
@MexD1SRR1561197.4/1
i used the following commands but it didnt changed anything:
sed 's/ HWI.*/\/1/g' SRR1561197_1.fastq > change.fastq
sed 's/ HWI.+/\/1/g' SRR1561197_1.fastq > change.fastq
Please help anyone?
I suspect that this is what you want:
sed 's|^@|@MexD1|; s| HWI.*|/1|g' SRR1561197_1.fastq > change.fastq
Note that HWT
was changed to HWI
.