Thanks, Its correct!
• 0 views
•
link
Hi I want to rename multiple file:
Old File Name is like this:
SRR4104645_1.fastq SRR4104648_1.fastq
SRR4104645_2.fastq SRR4104648_2.fastq
New File name should be like this:
SRR4104645_R1.fastq SRR4104648_R1.fastq
SRR4104645_R2.fastq SRR4104648_R2.fastq
Thanks, Its correct!
Hi,
this pure bash solution works too:
for i in *1.fastq; do mv $i ${i%_1.fastq}_R1.fastq; done && for i in *2.fastq; do mv $i ${i%_2.fastq}_R2.fastq; done
Just copy and paste to your terminal and it should rename all file.
for file in *.fastq; do mv -v $file ${file/_/_R}; done should be sufficient.
Log in to answer this question.
Do you want to add R in all the sample names?
Yes arup, I only need to add R...
There are dozens of answers out there:
https://stackoverflow.com/questions/30582799/how-do-you-mass-rename-files-in-linux
https://stackoverflow.com/questions/208181/how-to-rename-with-prefix-suffix
https://stackoverflow.com/questions/45688086/unix-renaming-files
https://unix.stackexchange.com/questions/98070/rename-files-in-directory
https://stackoverflow.com/questions/32038673/file-renaming-linux