I'm not sure this would be random enough but it might be.
- Open n output files (of1..ofn).
- Open the n input files (if1..ifn).
- Read a line from a random input file and write it to a random output file.
If you had to you could shuffle the output files later, but it would end up seeking somewhere along the line.
--traveler