2000-12-11 21:40:33 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
# this script will sort any table with the segment data type in its last column
|
|
|
|
|
|
|
|
while (<>) {
|
|
|
|
chomp;
|
|
|
|
push @rows, $_;
|
|
|
|
}
|
|
|
|
|
2010-11-23 21:27:50 +01:00
|
|
|
foreach ( sort {
|
2000-12-11 21:40:33 +01:00
|
|
|
@ar = split("\t", $a);
|
|
|
|
$valA = pop @ar;
|
|
|
|
$valA =~ s/[~<> ]+//g;
|
|
|
|
@ar = split("\t", $b);
|
|
|
|
$valB = pop @ar;
|
|
|
|
$valB =~ s/[~<> ]+//g;
|
|
|
|
$valA <=> $valB
|
|
|
|
} @rows ) {
|
|
|
|
print "$_\n";;
|
|
|
|
}
|