Q:

Union of large sets

I am trying to take union of thousands of set containing thousands of elements. However mathematica closes itself when I copy/paste the sets in Union[{}]. Do you have any suggestions to solve this problems? 

A:

Don't copy-n-paste - that's error prone, simply do it directly from the text files.
Here's an example:
SetDirectory["junk"];

(* create 10,000 files, each with 10,000 elements... *)
Monitor[Do[RandomInteger[1*^6, 10000] >> "set-" <> ToString[n] <> ".txt", {n, 10000}], n]

(* read the files, Union as we go, resulting in final result of `unions`... *)
unions = {}
Monitor[Do[unions = Union[unions, Get@set], {set, FileNames["*"]}], set]

This completed with no problems (as expected) on an old netbook with a gig of RAM...

