mat*_*ths 2 linux sorting bash duplicate-removal
-53 45
-54 43
-55 42
-56 41
-57 40
-59 37
-61 35
-61 36
-62 34
-64 33
-65 31
-65 32
-67 30
-68 29
-69 28
-72 25
-73 23
-73 24
-74 22
-76 20
-76 22
-78 20
-79 18
-80 17
-81 16
Run Code Online (Sandbox Code Playgroud)
在上面你会看到-61出现两次,所以做其他一些值.我想创建一个没有任何重复的新文件.所以新文件应该有-61 35或-61 36 ......
我怎么做?!我尝试使用uniq使用sort但是没有用.
假设您的数据位于名为input的文件中
cat input | sort -u -n
Run Code Online (Sandbox Code Playgroud)
在执行数字(-n)排序以及唯一(-u)时,将实现重复检查.