dextract is a tool which convert files. The normal usage is dextract -q test.h5 > test.fastq
. How is it possible to combine it with find command e.g. find All_RawData/Each_Cell_Raw/ -name "*.bax.h5" | xargs -I {} dextract -q {} >
How to get the file name after >
from find
command with fastq
extension rather h5
extension?
Asked
Active
Viewed 110 times
0

user977828
- 913
1 Answers
1
Like so:
find All_RawData/Each_Cell_Raw -name '*.bax.h5' -exec sh -c 'for f do dextract -q "$f" > "${f%.h5}.fastq"; done' find-sh {} +
With some line breaks for easier reading:
find All_RawData/Each_Cell_Raw -name '*.bax.h5' -exec sh -c '
for f
do dextract -q "$f" > "${f%.h5}.fastq"
done' find-sh {} +
For explanation and rationale, see https://unix.stackexchange.com/a/321753/135943.

Wildcard
- 36,499
find
. – Wildcard Jul 10 '17 at 22:58