I'm writing a UNIX shell script and I need to write a code using a text file. For each line in the text file, the third field ranges from 2 through 6.
2=Sparkling, 3=Foritified, 4=Sweet, 5=White, and 6=Red. I need to make it so that if the third field is a 2, it would add 1 to the counter "Sparkling" and so on. How can I do this? Thank you for any help