从重复块中提取数字
我有一个文本
文件,该文件包含重复
NOS的块,如下所示(使用> symbl),我只想提取一次重复值。
Input
>
1
2
3
4
10
100
>
1
2
3
4
10
100
expected output
1
2
3
4
10
100
我尝试了脚本
#!/bin/sh
uniq -d input > output
,但是它给出了与输入相同的输出。
I have a text
file that contain repeated
block of nos as given below(with > symbol) and I want to extract repeated values only once.
Input
>
1
2
3
4
10
100
>
1
2
3
4
10
100
expected output
1
2
3
4
10
100
I tried script
#!/bin/sh
uniq -d input > output
but it gives output same as input.can anybody suggest a solution on this.Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要先对其进行排序。尝试一下
或如果要将其保存为文件
you need to sort it first. Try this
or if you want to save it as a file
建议尝试:
Suggesting to try: