diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-12-03 21:51:02 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-12-03 21:51:02 +0100 |
commit | 2a316b36cc43c221df0d871b5ce3f94d4e1751a8 (patch) | |
tree | 10c969dca154c54a6fe09f58742f304969153c1e /share | |
parent | db9817329e3bfb53075414bab1263f9504820592 (diff) |
json2json: sort by name first, EVA ID second
Diffstat (limited to 'share')
-rwxr-xr-x | share/json2json | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/share/json2json b/share/json2json index 47cb83d..b559d1b 100755 --- a/share/json2json +++ b/share/json2json @@ -9,7 +9,8 @@ use JSON; my $json_str = read_file('stations.json'); my $stations = JSON->new->utf8->decode($json_str); -@{$stations} = sort { $a->{name} cmp $b->{name} } @{$stations}; +@{$stations} + = sort { $a->{name} cmp $b->{name} or $a->{eva} <=> $b->{eva} } @{$stations}; my $have_duplicates = 0; my @names = map { $_->{name} } @{$stations}; |