> Yes on wanting this in numbers but how else would you do it with software "built-in" to the Mac?
That's a highly leading question :)
A lot depends on the nature of the source data (single column? CSV? Spreadsheet? plain text?), your skills, and what third party apps you may have.
If you're skilled in the command line, then there are a myriad of command-line solutions.
If the files are just a list of names and you want to combine them:
cat a.txt b.txt | sort -u
this works by taking the contents of the files a.txt and b.txt and piping them into sort, where the -u switch tells it to output only unique values.
It's a little more complex if the files are tabular or comma-delimited, since you need to parse out the relevant field, but still doable. All the classic UNIX commands are available, including grep, sed, awk, and the ease (or otherwise ;) ) of these tools will depend on the complexity of the files and your shell scripting abilities.
Moving up the stack a little, reading, parsing, and writing files isn't that hard with AppleScript. Again, the difficulty will depend on the complexity of the file and how well you know AppleScript.
Personally, I'm a big fan of AppleScript. Here's an example script that combines unique lines from two files (it's probably not the most efficient, and may choke on very large files, but it shows the idea):
try
-- prompt the user for two files
set fileList to choose file with prompt "Select TWO text files to merge:" with multiple selections allowed
-- bail if two files weren't provided
if (count of fileList) is not 2 then error "Please select exactly two files."
-- extract the two files
set file1 to item 1 of fileList
set file2 to item 2 of fileList
-- read their contents into lists based on paragraphs
-- this will need more work if the files are comma-delimited
set file1Contents to paragraphs of (read file1 as «class utf8»)
set file2Contents to paragraphs of (read file2 as «class utf8»)
set mergedLists to MyMergeLists(file1Contents, file2Contents)
-- convert the lists to a single text stream
set outText to my MyJoinList(mergedLists, linefeed)
-- define the path for the output file
set outPath to ((file1 as text) & "_merged.txt") as text
-- write out the combined list
set fileRef to open for access file outPath with write permission
set eof of fileRef to 0
write outText to fileRef as «class utf8»
close access fileRef
-- and let the user know we're done
display dialog "Merge Complete" & return & "Output file: " & outPath buttons {"OK"} default button 1
on error errMsg number errNum
display dialog "Error " & errNum & return & errMsg buttons {"OK"} default button 1
end try
-- ====== HANDLERS ======
on MyMergeLists(initialList, appendList)
-- this works by starting with the first list, and appending the items in the second list
set outputList to initialList
repeat with thisItem in appendList
set t to thisItem as text
if (t is not "") and (t is not in outputList) then
set end of outputList to t
end if
end repeat
return outputList
end MyMergeLists
on MyJoinList(theList, delimiter)
set {oldtid, my text item delimiters} to {my text item delimiters, delimiter}
set outText to theList as text
set my text item delimiters to oldtid
return outText
end MyJoinList
(note that it's also possible to embed shell scripts within AppleScript, so I might just incorporate the shell commands above to to the heavy lifting :) )
If you're open to third party apps, there are a number of text-focussed apps that can do this out of the box. The venerable BBEdit even has a one-click option to process duplicate lines, and also supports regular expressions for more complex matches (e.g. delimited files, padded fields, etc.)