12.1 Program 'randomselect.py'

This simple program reads in a data file and randomly selects records according to the given argument. It writes these records unchanged into the output file. The program assumes that each record corresponds to one line.

The program is called from the command line with either the argument list

python randomselect.py  in_file  out_file  -perc  percentage_value
or
python randomselect.py  in_file  out_file  -num  num_records    
The needed arguments are