Off topic:Running Batch Files From Command Line
0
0
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
perl awk • 2.4k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2614 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6