How to get unique counts saved in a file
0
0
Entering edit mode
5.0 years ago
kittys • 0

Hello,

I am trying to extract the coverage counts from a file, and then sort these and have counts of the unique values. The coverage count data is in column 3 of my file.

I have been running this as my job, submitted on a slurm HPC:

awk '{print$3}' patient.coverage | sort | uniq -c > patient_coverage_counts

However this produces an empty output file and I am unsure why.

When I run

head patient.coverage | awk '{print$3}' | sort | uniq -c

The output prints to the output absolutely fine.

Any help or insight would be hugely appreciated!!

linux Sort Awk Unique counts • 670 views
ADD COMMENT
0
Entering edit mode

If you using --wrap to submit then you should enclose the full command in quotes like --wrap="awk '{print $3}' patient.coverage | sort | uniq -c > patient_coverage_counts".

ADD REPLY
0
Entering edit mode

and trying

cut -f 3 patient.coverage | sort | uniq -c > patient_coverage_counts

? if that works, it's may be a problem with the 'dollar'

ADD REPLY

Login before adding your answer.

Traffic: 1655 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