How to Merge multiple files, removing duplicate values
If you have multiple files and you want to remove duplicate values from, while creating a single file.
File1 (one.txt):
File2 (two.txt):
As you can see, the two files contain some duplicates. You can easily remove these using the following command:
|
|
This will output:
You can as easily pipe this into a third file as follows:
|
|
This will take the first two files (you can add as many as you like), and pipe the output into a file called three.txt
.
Simple!