How can I select 160 lines randomly from a text file and print them to another...

wxextreme

New member
...using Perl? I have a text file with around 1000 lines of data in the .txt file. I used perl to sort through all the data and parse them. I am having difficulty with the rand function and the srand function. I was wondering if someone would know a good way to program this. I have to parse this data for research I am currently conducting. I need to get rid of data bias, so Perl has to do the unbiased work for me to select specific dates out of the file for me. I was wondering if anyone could help. Thanks.
 
The perl based application Replace Pioneer can do:
1. launch "replace pioneer", ctrl-o open file
2. ctrl-h open 'replace' window
* set 'replace with pattern' to rand_str_unique(-160,split('\n',$match))
3. click 'replace', done!

RP free trial download:
 
Back
Top