Alphabetizing with a twist 
Author Message
 Alphabetizing with a twist

I have an alphabetizing sort routine:


by the first character in each line. The array entries are
piped data lists, so an example of the result would be:
aaa|bbb|.....
bbb|aaa|.....

How can I change the code snippet so that I can alphabetize
by the second (or third etc) field in the array. My two
entries above, if alphabetized by the second field, would
look like this:
bbb|aaa|.....
aaa|bbb|.....

Any suggestions?

Thanks ahead.

Ed
--
Datatrend Software
http://www.*-*-*.com/

Grab It! Graph Digitizer for MS Excel
Double Check It Products
AutoMail Scripts for Website Automation
----------------------------------------------------



Wed, 18 Jun 1902 08:00:00 GMT  
 Alphabetizing with a twist

  EP> I have an alphabetizing sort routine:


  EP> by the first character in each line. The array entries are

first field, not character.

  EP> How can I change the code snippet so that I can alphabetize
  EP> by the second (or third etc) field in the array. My two

this is in perlfaq4. ever think you might not be the first person to need
to do that? the faq is titled: how can i sort and array by (anything)?

uri

--

SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Because twisted minds think twisted things...

2. How about a little twist on the shredding?

3. char to number conversion w/ a twist

4. search with a twist

5. s2p twisted

6. Sourcing with a twist of Parsing ?

7. Random Numbers with a Twist

8. A problematic twist with =~ and regex

9. Counter with an NT twist

10. Summary of answers to alphabetize/letter count script

11. ALPHABETIZING?!?

 

 
Powered by phpBB® Forum Software