in reply to Re^2: Sorting a text file
in thread Sorting a text file
This is essentially a variant of the Schwartz Transform, using a hash in place of an array to keep the sort field(s).my %data; ( $data{ $_}) = /^\d+\s+(\d+)/ while <DATA>; print for sort { $data{ $a} cmp $data{ $b} } keys %data;
Anno
|
|---|