ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
How to sort these elements
by Maxmelbin Neson other posts by this author
Oct 26 2005 4:15AM messages near this date
view in the new Beta List Site
RE: spidering/crawling/scraping a site.. | Re: How to sort these elements
Hello ,

Contents of my array is as follows

@a= ("/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/1" ,
      "/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/4" ,
	
"/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/12"
	
"/view/test.max2kor1/vobs/maxvob/max.c@@/main/tmp_maxtest1/7" ,
	
"/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/2",
	
"/view/test.max2kor1/vobs/maxvob/max.c@@/main/tmp_maxtest1/17" 
	
"/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/102");
							
			

The last part of each line is versions of the files respectivly ..

If I give a sort as 

@b= sort(@a);
The output is as follows

	
 /view/test.max2kor1/vobs/maxvob/max.c@@/main/tmp_maxtest1/17 
 /view/test.max2kor1/vobs/maxvob/max.c@@/main/tmp_maxtest1/7 
 /view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/1
/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/102
/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/12
/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/2
/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/4 

How do I sort it so that I get the following correct output as follows


 /view/test.max2kor1/vobs/maxvob/max.c@@/main/tmp_maxtest1/7 
 /view/test.max2kor1/vobs/maxvob/max.c@@/main/tmp_maxtest1/17 
 /view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/1
/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/2
/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/4 
/view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/12 
 /view/test.max2kor1/vobs/maxvob/satish.c@@/main/tmp_maxtest1/102 

Advance Thanks for the Help ...

Thanks and Regards
Maxmelbin Neson
------------------------------------------------------------------------
-----------------------------------------
Robert Bosch India Limited
Engineering Services - DS - Methods and Tools (RBIN/EDM3)
123 Industrial Layout  -  Hosur Road -  Bangalore 560 095  -  INDIA
Telephone: +91 80 5119-4532	 Fax: +91 80 2508-1404
maxmelbin.neson@[...].com
www.bosch.com
Attachments:
unknown1
unknown2
unknown3
unknown4

Thread:
Maxmelbin Neson
Chris Wagner
Joe Discenza

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved