Hi All,
Would you guys help me?
I have a file that consists of several unstructured fields. in this file I will take the code field and count_berry field.
but the position of the count_berry field is always changing.the column for code is always structured, which is found in column 6
I have found the count_berry field to be in a definite column, that is in columns 10, 12 (count_berry, 100) then in column 14.16 (count_berry, 10) then in column 24.26 (count_berry, 200).
so I can create a script to retrieve the columns and values by using awk like this:
cat file |awk '$10 == "\"count_berry\"" {print $6 "," $12 };$14 == "\"count_berry\"" {print $6 "," $16};$24 == "\"count_berry\"" {print $6 "," $26}'
the problem is, how do I get an unknown count_berry column? can anyone help me make the if condition code on awk?