我有一个值列表,其中可能包含特殊字符,所有类型的字符。
jusewe@somemail.com
Denver Occupy|another name|metadata
another name
metadata
我需要一种在linux
或sed
、awk
中使用uniq
实用程序作为输出的方法:上面列表中的唯一值:
jusewe@somemail.com
Denver Occupy
another name
metadata
我尝试过的:
uniq -u test
uniq 只有在重复行相邻时才有效
将给出排序的 Uniq 值
sort -u test
编辑:在|
上拆分行
tr '|' 'n' < test | sort -u
sed -ne "s/|/n/p" test |sort |uniq
享受