PROCESS_DT IN '01/01/2009' PROCESS_DT IN '05/23/2006' PROCESS_DT IN '01/01/2011' PROCESS_DT IN '04/19/2009' PROCESS_DT IN '07/01/2009'
I have been working on attempting to sort these strings by the date. However I'm not having much luck and am looking for a little guidance.
Here are some sorts I have tried
#my @sort = sort { $a <=> $b } @GoodToMove; #my @sort = sort { uc $a cmp uc $b} @GoodToMove; #my @sort = sort { lc +($a) cmp lc($b)} @GoodToMove; #my @sort = sort { $b cmp $a } @GoodToMove; #my @sort = map { $_->[0] } # sort { (split /\'/, $a, 1)->[1] cmp (split /\'/, $b, 1)->[1] } # map { [ $_, uc( (/\d+\s*(\S+)/)[0]) ] } @GoodToMove; #my @sort = # map $_->[0], # sort { $a->[1] cmp $b->[1] } # map [ $_, join('', (/(..)-(..)-(....)/)[2,1,0]) ], # # map [ $_, join('', (/(..):(..):(..)/)[2,1,0]) ], @GoodToMove; my @sort = map { $_->[0] } sort { (split /\'/, $a, 0)->[1] cmp (split /\'/, $b, 0)->[1] } map { m/(\d\d)\/(\d\d)\/(\d{4})/; [$_, "$3$2$1"] } @GoodToMove;
Anyone have any thoughts or possibly see what I am missing?
In reply to Sort text string by the date embedded by and_noel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |