This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Batch convert .dsrc to .fastq

I am using the DSRC toolkit to decompress many RNA-seq .dsrc files to .fastq, and I would like to batch convert multiple files at once. When I run,

for i in *.dsrc ; do dsrc d -t63 -s $i > $i.fastq ; done

the files have a .dsrc.fastq extension. How do I remove the .dsrc from the file name? Thanks in advance.

rna-seq

2 answers

The correct bash parameter is ${i%.*}, as in: for i in *.dsrc ; do dsrc d -t63 -s $i > ${i%.*}.fastq ; done.

for i in *.dsrc ; do dsrc d -t63 -s $i > ${i%.*}.fastq ; done

Duplicated answer.

Yup! :) I figured it out shortly after posting. Thanks!

Log in to answer this question.