开发者

simple diff question

file1.txt is

  • 10
  • 20
  • 30
  • 40
  • 50

file2.txt is

  • 10
  • 20
  • 40
  • 60
  • 70
  • 80

I want output.txt to be a union of numbers in these two 开发者_如何学Pythonfiles but with no duplicates. Output.txt should be

  • 10
  • 20
  • 30
  • 40
  • 50
  • 60
  • 70
  • 80


If you don't need to preserve the order within the individual files:

cat file1.txt file2.txt | sort | uniq > output.txt
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜