in reply to Re^2: Sorting one column of results
in thread Sorting one column of results
I assumed you knew more about Perl. My fault. When using a function you do not know yet, consult its documentation.
Here is what I had in mind:
Here is what I had in mind:
#!/usr/bin/perl use warnings; use strict; my $infile = 'orders.txt'; my $output = 'orders_today.txt'; open my $IN, '<', $infile or die "ERROR: Cannot open '$infile': $!"; my @out; while (<$IN>) { chomp; my @text = split /\t/; push @out, [@text]; } open my $OUT, '>', $output or die "Cannot open '$output': $!"; print {$OUT} map "@$_\n", sort { $a->[10] cmp $b->[10] } @out;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Sorting one column of results
by perlnoobster (Sexton) on Nov 12, 2012 at 11:25 UTC | |
by Anonymous Monk on Nov 13, 2012 at 10:29 UTC |
In Section
Seekers of Perl Wisdom