From 7a1fc72ee20d7426bf2d7f624b1ff55f875de9c7 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 6 Sep 2007 08:01:55 +0000 Subject: nicely sort MonitorsDB (needed by XFdrake): have "Flat Panel 800x600" before "Flat Panel 1024x768" --- convert/sort_MonitorsDB.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 convert/sort_MonitorsDB.pl (limited to 'convert') 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; -- cgit v1.2.1