That makes it simpler.

You know you have a pretty small data set, so
  1. Dimension your array up front, say 1000 elements.
  2. Read each file in turn, and for each line read...
  3. If the line exists in the array then ignore it.
  4. If the line does not exist, add it to the array and write it to your output file.


Job done, easy eh?

Look up information on the following commands in the manual:
DIM, Dir(), Open(), ReadLine(), WriteLine(), Ascan().

Have a go, and post again if you start to struggle.