I have 2 plain text files that contain some words, like:
File 1
Aarhus
Abbott
Abbott's
Abel
Abelian
Abelson
Abelson's
Aberdeen
Aberdeen's
File 2
Acapulco
Ackerman
Acta
Adam
Adams
Adamson
This is just a sample list, the files contain more than 10000 entries and the words can be placed in any order. but one thing that makes it easy is that every single line contains only one word. Now, I know how to read these values using php one by one, but I cant understand how to merge these two files and sort them alphabetically. Can anyone suggest me how to do the sorting part?
EDIT
One more thing to mention: As you can see, there are some words containing a ' single quote. Please suggest me the answers that consider this parameter while sorting.
FURTHER EDIT
I want to eliminate duplicate values from the files. Like if there are 2 same words, then it should be taken only once.
1 Answer