summaryrefslogtreecommitdiffstats
path: root/convert/sort_MonitorsDB.pl
diff options
context:
space:
mode:
Diffstat (limited to 'convert/sort_MonitorsDB.pl')
-rwxr-xr-xconvert/sort_MonitorsDB.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/convert/sort_MonitorsDB.pl b/convert/sort_MonitorsDB.pl
new file mode 100755
index 00000000..4cabedb3
--- /dev/null
+++ b/convert/sort_MonitorsDB.pl
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+use POSIX;
+use locale;
+$ENV{LC_COLLATE} || $ENV{LANG} or setlocale(LC_COLLATE, "fr_FR");
+
+my @l = <>;
+
+@l = map { $_->[1] } sort { $a->[0] cmp $b->[0] } map {
+ my $val = $_;
+ chomp;
+ s!^\s*(#.*|$)!!;
+ s!(;.*?);.*!$1!;
+ s/(\d+)/sprintf("%06d", $1)/e;
+ [ $_, $val ];
+} @l;
+
+print foreach @l;