joining more than 1 array

Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Apr 2009
Posts: 19
Reputation: ajay_p5 is an unknown quantity at this point 
Solved Threads: 0
ajay_p5 ajay_p5 is offline Offline
Newbie Poster

joining more than 1 array

 
0
  #1
Oct 20th, 2009
Helllo all,
well I am trying to split a file on the basis of space first and then trying to join it with "-" but i am not able to do it, can sumone please suggest what should I do in order to do it.
I am attaching the required part of the whole code where I think the changes are required. It is just that i have a list of dates like this 30 jun 2008 and i want to change it in this format 30-jun-2008.

Thanks
Aj
  1. if ($lines =~m/Date/)
  2. {
  3. $lines=~s/\s+$//g;
  4. @aj2=split(/:/,$lines);
  5. push(@date,$aj2[1]);
  6. my($dd,$mm,$yy) = (split(/\s/,$date[0]))[1,2,3];
  7. push(@date1,"$dd");
  8. push(@month1, "$mm");
  9. push(@year1,"$yy");
  10. my($date2)= (join('-',@date1,@month1,@year1));
  11. print"$date2";
  12. }
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 8
Reputation: vbharathi is an unknown quantity at this point 
Solved Threads: 1
vbharathi vbharathi is offline Offline
Newbie Poster
 
0
  #2
Oct 21st, 2009
1. if ($lines =~m/Date/) {
2 $lines=~s/\s+$//g;
3. @aj2=split(/:/,$lines);
4. push(@date,$aj2[1]);
5. my($dd,$mm,$yy) = (split(/\s/,$date[0]))[1,2,3];
6. my($date2)= (join('-',$dd,$mm,$yy));
7. print $date2;
try this....it will work
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 19
Reputation: ajay_p5 is an unknown quantity at this point 
Solved Threads: 0
ajay_p5 ajay_p5 is offline Offline
Newbie Poster
 
0
  #3
Oct 21st, 2009
Thanks..it works.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC