From 2a316b36cc43c221df0d871b5ce3f94d4e1751a8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 3 Dec 2022 21:51:02 +0100 Subject: json2json: sort by name first, EVA ID second --- share/json2json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share/json2json') 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}; -- cgit v1.2.3