If the test file below is representative of the file in the actual task, then the following may be useful.
Based on the fact that each line of the test file is homogeneous, that is, it is well formatted and contains 8 columns (or fields), a convenient solution using the cut will look like this:
File:
Unable to find latest released revision of 'CONTRIB_046572' Unable to find latest released revision of 'CONTRIB_046578' Unable to find latest released revision of 'CONTRIB_046579' Unable to find latest released revision of 'CONTRIB_046570' Unable to find latest released revision of 'CONTRIB_046579' Unable to find latest released revision of 'CONTRIB_046572' Unable to find latest released revision of 'CONTRIB_046579'
Code:
cut -d ' ' -f 8 file | tr -d "'" | sort | uniq -c
Output:
1 CONTRIB_046570 2 CONTRIB_046572 1 CONTRIB_046578 3 CONTRIB_046579
Note on the code: the default separator used by cut to separate each field is tab , but since we need the separator to be the only space to separate each field, we specify the -d ' ' option. -d ' ' The rest of the code is similar to the other answers, so I will not repeat the above.
General note: this code will probably not achieve the desired result if the file was not well formatted, as I mentioned above.
source share