Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
And the input file :use strict; my $column=3; my @F; my @sort_col; my @lines; my $file=$ARGV[0]; while(<>) { #print "Input line " .$_; @F=split(/\|/,$_); print "Array elesems $F[3]\n"; push @sort_col, $F[$column]; push @lines, "$_"; } print @lines[sort{ $sort_col[$a] lt $sort_col[$b] } 0..$#sort_col] ;
ThanksD|0|95465tan|2|4|4|14028.77|0.00|BF2-002|22/09/2009|07/01/2009|06/09/2 +009|45544564| D|0|954564545|1|4|abar_BF4|4|3913.17|0.00|accabar_BF4-003|22/09/2009|0 +7/02/2009|06/09/2009|10254754| D|0|a454654|1|4|ar_BF4|4|3913.17|0.00|acctrabar_BF4-003|22/09/2009|07/ +02/2009|06/09/2009|11122323| D|0|Chking|1|4|arabar_BF4|4|3913.17|0.00|acarabar_BF4-003|22/09/2009|0 +7/02/2009|06/09/2009|11122323|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparison of alphanumeric strings
by almut (Canon) on Sep 17, 2009 at 10:34 UTC | |
|
Re: Comparison of alphanumeric strings
by GrandFather (Saint) on Sep 17, 2009 at 10:40 UTC | |
by Anonymous Monk on Sep 17, 2009 at 10:45 UTC | |
by GrandFather (Saint) on Sep 17, 2009 at 11:00 UTC | |
by Anonymous Monk on Sep 17, 2009 at 12:18 UTC | |
by GrandFather (Saint) on Sep 17, 2009 at 20:36 UTC | |
by Anonymous Monk on Sep 17, 2009 at 11:28 UTC |