A
asm_toronto
Hi,
I am wondering if someone can direct me on how to randomize the records
as I rewrite them. Hope to catch someone in a good mood to help an
eternal
amateur.
Al i want to do is to take an existing datafile with 100 records, and
rewrite them
in random order. (Each only has one field.)
Here is what I have:
open (DATA, "$BaseDir/my_db.txt");
@Ads = <DATA>;
close DATA;
open (CREATEFILE, ">$BaseDir/mydb_new.txt");
close (CREATEFILE);
foreach $Ad (@Ads) {
@Field = split (/\|/, $Ad);
open (LIST, ">>$BaseDir/agentdb_new.txt");
print LIST "$Field[1]\n";
close LIST;
}
I am wondering if someone can direct me on how to randomize the records
as I rewrite them. Hope to catch someone in a good mood to help an
eternal
amateur.
Al i want to do is to take an existing datafile with 100 records, and
rewrite them
in random order. (Each only has one field.)
Here is what I have:
open (DATA, "$BaseDir/my_db.txt");
@Ads = <DATA>;
close DATA;
open (CREATEFILE, ">$BaseDir/mydb_new.txt");
close (CREATEFILE);
foreach $Ad (@Ads) {
@Field = split (/\|/, $Ad);
open (LIST, ">>$BaseDir/agentdb_new.txt");
print LIST "$Field[1]\n";
close LIST;
}