Entering edit mode
10.1 years ago
bioinfo
▴
830
I have around 50 similar .txt files in a folder. I extracted the info I need from txt files. I was wondering how to run all these 50 files (less *.gz.txt| awk '..
. doesn't create .output.txt
for individual input .txt files) in a single run with individual output files?
Input files look like below:
BACP0000929|xaiA|gi|302543193|ref|ZP_07295535.1|_<97>:0:664:+ 0 0.0 0.0 0.0
BACP0000011|fytD|gi|340626483|ref|YP_004744935.1|_<97>:0:657:+ 0 0.0 0.0 0.0
BACP0008288|cuyD|gi|365866299|ref|ZP_09405920.1|_<97>:0:660:+ 0 0.0 0.0 0.0
Used command:
less 9673.fna.gz.txt | awk '{OFS="\t"; split($1,x,"|"); print x[2], $2}'| awk '$2 > 0'| sort -k2r| uniq –c | sort -rn > output.txt
Output:
286 xaiA 1
236 FabB 1
170 uyTB 1
166 yuTB 1
152 iopC 1