mirror of https://github.com/postgres/postgres
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
346 B
21 lines
346 B
![]()
25 years ago
|
#!/usr/bin/perl
|
||
|
|
||
|
# this script will sort any table with the segment data type in its last column
|
||
|
|
||
|
while (<>) {
|
||
|
chomp;
|
||
|
push @rows, $_;
|
||
|
}
|
||
|
|
||
|
foreach ( sort {
|
||
|
@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";;
|
||
|
}
|