Reputation:
I have a list of values, that may have in them special characters, all kind of characters.
[email protected]
Denver Occupy|another name|metadata
another name
metadata
I need a way with uniq
utility in linux
, or sed
, awk
, to have as output:
unique values from above list:
[email protected]
Denver Occupy
another name
metadata
What i have tried:
uniq -u test
Upvotes: 1
Views: 228
Reputation: 19315
uniq will work only if repeated lines are adjacent
will give uniq values sorted
sort -u test
EDIT: to split lines on |
tr '|' '\n' < test | sort -u
Upvotes: 1