I have a folder with a numbers of txt
files, I would like to apply the for do do
loop to convert them from txt
to biom
files, the following is what I did:
for txt in folder/*.txt
do biom convert -i $txt -o *.biom --to-hdf5
done
but I got a combined biom file.
How can I revise my above code, changing the multiple txt files to biom files, without changing the original file name?
like: test.txt
to test.biom
The following should do the trick (assuming there are now spaces in the filenames):
The bash substitution
${txt%.txt}
strips.txt
of the variable, and we tack.biom
at the end.