softworkz has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monks. While having a typical day fumbling around in MS access sorting some records. A co-worker comes in and asks whadia sorting by yada yada later on he says... Your lucking "they" didn't ask for you to sort by Middle initial, 2nd letter of their first name and last letter of last name.
Knowing it can be done with Perl I'd like to slap this list on his desk and say here, there you go! lol Any ideas would be helpful looking at sort, reverse and cmp but stuck on part 2nd letter of first name..
Here's an example, thanks!
INPUT
FNAME LNAME MNAME SURNAME
john,doe,sam,jr
albert,simpson
barry,white,,III
harry,potter
steve,zurk,james,sr
OUTPUT
barry,white,,III
harry,potter
albert,simpson
steve,zurk,james,sr
john,doe,sam,jr
Knowing it can be done with Perl I'd like to slap this list on his desk and say here, there you go! lol Any ideas would be helpful looking at sort, reverse and cmp but stuck on part 2nd letter of first name..
Here's an example, thanks!
INPUT
FNAME LNAME MNAME SURNAME
john,doe,sam,jr
albert,simpson
barry,white,,III
harry,potter
steve,zurk,james,sr
OUTPUT
barry,white,,III
harry,potter
albert,simpson
steve,zurk,james,sr
john,doe,sam,jr
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: sorta sorting fun
by moritz (Cardinal) on Feb 07, 2008 at 20:27 UTC | |
Re: sorta sorting fun
by kyle (Abbot) on Feb 07, 2008 at 21:33 UTC | |
Re: sorta sorting fun
by roboticus (Chancellor) on Feb 08, 2008 at 03:56 UTC | |
by softworkz (Monk) on Feb 08, 2008 at 16:41 UTC | |
by softworkz (Monk) on Feb 08, 2008 at 21:29 UTC |
Back to
Seekers of Perl Wisdom