to get random 1 million samples
by - Thursday, January 1, 1970 at 12:00 AM
to get random 1 million samplesPerl[code]open (IN,$ARGV[0]);open (MAIL,">rand.txt");$rand_get=0;$total_get=0;while () { $total_get++; if (int (rand(100)) == 5) { printf("Parsed: $total_get|$rand_get "); } if ($rand_get <= 1000000) { if (int (rand(250)) == 5) { print MAIL $_; $rand_get++; } } } close IN;close MAIL;[/code]
Beneath this mask there is more than flesh. Beneath this mask there is an idea, and ideas are bulletproof.

Reply
Perl is cool
Reply
how to get 2 millon?
Reply
(May 31, 2022, 04:17 AM)dubdubdub Wrote: how to get 2 millon?


change this to whatever number's you like 1000000
Beneath this mask there is more than flesh. Beneath this mask there is an idea, and ideas are bulletproof.

Reply
(May 26, 2022, 11:51 PM)Blood Wrote: to get random 1 million samples
Perl


open (IN,$ARGV[0]);
open (MAIL,">rand.txt");

$rand_get=0;
$total_get=0;

while (<IN>)
  {
  $total_get++;
  if (int (rand(100)) == 5)
  {
  printf("Parsed: $total_get|$rand_get 
");
  }
   

   
    if ($rand_get <= 1000000)
      {
      if (int (rand(250)) == 5)
    {
    print MAIL $_;
    $rand_get++;
    }
      }
  }
 
close IN;
close MAIL;


Just like that =)Thanks! where is the limit of the MuLTiverse?
Reply


 Users viewing this thread: to get random 1 million samples: No users currently viewing.