Perform natural sorting on file names before plotting profiles

This commit is contained in:
2011-09-22 15:42:45 +00:00
parent 45f076bef8
commit 079fd24c12
3 changed files with 25 additions and 6 deletions

View File

@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'TrimSPGUI.ui'
#
# Created: Thu Aug 11 16:45:18 2011
# Created: Thu Sep 22 17:41:56 2011
# by: The PerlQt User Interface Compiler (puic)
#
# WARNING! All changes made in this file will be lost!
@ -2692,7 +2692,11 @@ sub PlotProfiles
this,
"Select RGE files dialog",
"Choose RGE file to plot");
my @files = @$files_ref;
my @files_tmp = @$files_ref;
# Do "natural" sorting on the file name list
# This will produce (hopefully) a plot with largest needed depth scale
my @files = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @files_tmp;
my $filenames=join(",",@files);
if ($filenames ne "" ) {