Hello everybody!
I am quit new here and hope you can help me.
Using an awk script I am trying to extract data from several files. The structure of the input files is as follows:
TimeStep parameter1 parameter2 parameter3 parameter4
e.g.
1 X Y Z L
1 D H Z I
1 H Y E W
2 D H G F
2 R T U V
3
.
.
.
I would like to count the number entries from time step 1, 2, 3... containing certain parameters, respectively.
I already wrote a script that is extracting entries with specific parameters. However I am still struggling with getting with the information how many entries of time step 1, 2 and 3 contain e.g. parameter Z in $4 (2 for time step 1 and 0 for all other in the example above).
I Would prefer to do everything within a single script awk because I got a lot of data and later only want to change the parameter selection.
I already tried to do it within for and while loops but it did not work as I wanted it to... well I am just starting with awk
Thanks for your help guys!