|
|
|
Febrl - Freely extensible biomedical record linkage |
|
|
|
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
- in_file
Name of the input file with the original data records.
- out_file
Name of the output file where the randomly selected records are
written into.
-perc
percentage_value
Set the percentage of how many records should be selected
randomly. The percentage value must be larger than 0.0 and
smaller than 100.0.
-num
num_records
Alternatively, the absolute number of records to be selected
randomly can be given as an argument. The value must be
positive, and smaller than the total number of records in the
input file.
Release 0.3.1, documentation updated on July 1, 2005.