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
 加载中,请稍侯......
      
精彩评论