I have a column, with some words:
scatman
batman
superman
scatman
scatman
batman
superman
scatman
scatman
batman
superman
scatman
batman
WWWWWWWW
superman
scatman
batman
superman
scatman
I should make some patterns, where i need to have word by word three words: scatman, batman, superman. Where, i have repeat words, like scatman & scatman on line 4 & 5 or where i have other words, i should cut them I have written:
grep "scatman\|batman\|superman" file
Ok, i have rejected word WWWWWWWW, but i can't understand how to show my column word by word. Ihave in result:
scatman
batman
superman
scatman
scatman
batman
superman
scatman
scatman
batman
superman
scatman
batman
superman
scatman
batman
superman
scatman
At line 4 & 5 i have repeat words, but i don't like that. Where i have the mistake ?