Re: Intelligent Sorting

2005-07-07 Thread Scott R. Godin
Jeff 'japhy' Pinyan wrote: On Jul 6, Ryan Frantz said: I'm working on a script that will generate a listing of files on a regular basis so that I can create hyperlinks to each respective file. As you see from the sorted output below, though it is in ASCIIbetical order, it is not in chronologica

Re: Intelligent Sorting

2005-07-07 Thread Wiggins d'Anconia
Ryan Frantz wrote: [snip] > > Many thanks to Wags and japhy; I've really learned a lot from the both > of you. I'm off the pick up 'Programming Perl' after I finish 'Learning > Perl'... > > ry > Pick up the Learning Perl Object, References, and Modules book before picking up Programming Perl,

RE: Intelligent Sorting

2005-07-07 Thread Ryan Frantz
> Just take and replace that with @user_links. The code should > look like: >@user_links = ( sort { > $a->[1] <=> $b->[1] >or > $AlphaToNumber{lc($a->[2])} <=> $AlphaToNumber{lc($b->[2])} >or > $a->[3] <=> $b->[3] >} >map {[$_, /^.(\d{4})(\w{3})(\d{

RE: Intelligent Sorting

2005-07-07 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ryan Frantz wrote: >> Here is one way to approach: >> !perl >> >> use strict; >> use warnings; >> >> my %AlphaToNbr = qw(jan 1 feb 2 mar 3 apr 4 may 5 jun 6 jul 7 aug 8 >> sep 9 oct 10 nov 11 dec 12); foreach my $MySortedFile (sort { >> $a->[1] <=> $b->[1] >> or >>$Al

RE: Intelligent Sorting

2005-07-07 Thread Jeff 'japhy' Pinyan
On Jul 7, Ryan Frantz said: foreach my $MySortedFile (sort { $a->[1] <=> $b->[1] or $AlphaToNbr{lc($a->[2])} <=> $AlphaToNbr{lc($b- [2])} or $a->[3] <=> $b->[3] } map {[$_, /^.(\d{4})(\w{3})(\d

RE: Intelligent Sorting

2005-07-07 Thread Ryan Frantz
> Here is one way to approach: > !perl > > use strict; > use warnings; > > my %AlphaToNbr = qw(jan 1 feb 2 mar 3 apr 4 may 5 jun 6 jul 7 aug 8 sep 9 > oct 10 nov 11 dec 12); > foreach my $MySortedFile (sort { $a->[1] <=> $b->[1] > or >$AlphaToNbr{lc($a->[2])} <=> $Alph

Re: Intelligent Sorting

2005-07-06 Thread Jeff 'japhy' Pinyan
On Jul 6, Ryan Frantz said: I'm working on a script that will generate a listing of files on a regular basis so that I can create hyperlinks to each respective file. As you see from the sorted output below, though it is in ASCIIbetical order, it is not in chronological order: /2005Jul01-2005Jul

RE: Intelligent Sorting

2005-07-06 Thread Ryan Frantz
> > Is there any decent documentation available that I could study so > > that I can sort this better? > > As soon as I hit Send on this email I checked my 'Learning Perl' book and found some information (Ch. 15, not that far yet ;^)). Prior to implementing anything, I want to understand what's g

RE: Intelligent Sorting

2005-07-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ryan Frantz wrote: > Perlers, > > I'm working on a script that will generate a listing of files on a > regular basis so that I can create hyperlinks to each respective file. > As you see from the sorted output below, though it is in ASCIIbetical > order, it is not in chronological order: > > /200