I have been trying to find a solution but now I need some help.First, as input, I have a Big File (5.5G) with this structure:scaffold4691_size302    2       T       1scaffold4691_size302    3       A       1scaffold4691_size302    4       a       1scaffold4691_size302    5       a       1scaffold4691_size302    6       g       2scaffold4691_size302    7       c       2scaffold4691_size302    8       c       2scaffold4692_size187    68      g       4scaffold4692_size187    69      c       4scaffold4692_size187    70      a       4scaffold4692_size187    71      a       4What I want is to count for each ID of the FIRST column ($1), how many times the value in the FOURTH column ($4) is greater than or equal to X (e. g. X=4 in the toy model).So, as input, I expect:scaffold4691_size302    0scaffold4691_size187    4I could easily do it on python as I am more confortable with it but the size is too large.So far, I did this: awk 'NR>1 { scf=$1; { if ($4>=4){count++;}}} {print scf \t count}' toyModelBut it returns me all the line and a total count. I want to know how to refresh the count for a new ID.
Awk - Compare Value from a column with a variable, count how many times it passes for each ID
awk;large files