Issue
I have a file containing many words ending in a .
, most of which are abbreviations, e.g.:
- etc.
- p.s.
How can I output a list which shows all of these words, only once?
- All of the words have a space before, so this space can be used to find the beginning of the word.
- None of the words appear at the beginning of the line.
- There are no sentences in the file, so the periods are all used in this manner.
Solution
One of the ways to do it would be:
egrep -o '\b[^ ]+\.' < list_of_words | sort | uniq
Answered By - MichaĆ Trybus Answer Checked By - Gilberto Lyons (WPSolving Admin)