| Category: | Utilities |
| Author/Contact Info | Sean Kelly / mail@shortestpath.org |
| Description: | Take a file on standard input, randomise order of lines and print to standard output |
#!/usr/bin/perl -w
##
## randomiseLines.pl
## Take a file on standard input, randomise order of lines and
## print to standard output
##
## Sean Kelly <mail@shortestpath.org>
##
## v0.1 1/June/2001
use strict;
my %lines;
while (<>)
{
$lines{ rand() } = $_;
}
my $line;
foreach $line (sort keys %lines)
{
print $lines{$line};
}
|
|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: randomiseLines
by blakem (Monsignor) on Jun 01, 2001 at 14:04 UTC | |
by davorg (Chancellor) on Jun 01, 2001 at 14:23 UTC | |
|
Re: randomiseLines
by ChOas (Curate) on Jun 01, 2001 at 14:09 UTC | |
|
Re: randomiseLines
by bwana147 (Pilgrim) on Jun 01, 2001 at 19:52 UTC | |
by myocom (Deacon) on Jun 01, 2001 at 20:24 UTC | |
|
Re: randomiseLines
by bikeNomad (Priest) on Jun 02, 2001 at 20:26 UTC | |
|
Re: randomiseLines
by fx (Pilgrim) on Jun 02, 2001 at 15:47 UTC |