Created
November 27, 2023 22:05
-
-
Save pmagwene/1eccb95b612eb08eb71b8e5f7da31c92 to your computer and use it in GitHub Desktop.
Awk example from class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
FS="\t" | |
OFS="," | |
genect = 0 | |
} | |
# filter the comments | |
$0 ~ /^#/ { next } | |
{ | |
ftrcount[$3] += 1 | |
# print $3, ftrcount[$3] | |
} | |
END { | |
for (ftr in ftrcount) | |
print ftr, ftrcount[ftr] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment