I'm pretty new to scripting and didn't see an example of this issue yet. I am trying to count and print the total number of times each value is found within a file. Here is a short example of my starting file.
value 3
value 3
value 3
value 3
value 4
value 6
value 6
value 6
value 6
value 8
value 8
value 8
The entire file I am working with is very large and I will not be able to know each value in advance. I'm trying to get to a file that looks like this
value 3 4
value 4 1
value 6 4
value 8 3
... .... ...
with column 3 being the total number of times a specific value (i.e value 3) is found within the file.
I've tried a couple different grep and wc commands but these seem to be fore specific searches. Any help would be appreciated.
Thanks