Hi,
I have 40 fastq files named as
SRR1313062_GSM1401648_ZR-75-1_Homo_sapiens_RNA-Seq_1.fastq.gz
SRR1313062_GSM1401648_ZR-75-1_Homo_sapiens_RNA-Seq_2.fastq.gz
until
SRR1313131_GSM1401717_06-01-A009b_Homo_sapiens_RNA-Seq_1.fastq.gz
SRR1313131_GSM1401717_06-01-A009b_Homo_sapiens_RNA-Seq_2.fastq.gz
I want to change these names to
SRR1313062_1.fastq.gz
SRR1313062_2.fastq.gz
and so on until
SRR1313131_1.fastq.gz
SRR1313131_2.fastq.gz
Have tried :
rename 's/(\w_).*_(R[0-9])_.*(.fastq.gz)/$1$2$3/' filenames
and
brename -p '^(\w+)_.+_.+(_R[12]_).+' -r '${1}$2.fastq.gz' filenames
but nothing is working. Can someone kindly help.
If _GSM...RNA-seq is common in all names, keep it simple:
with parallel
If you would like to use regex, use following:
The
brename
version should be