0

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

if ($lines =~m/Date/)
          {
	   $lines=~s/\s+$//g;
           @aj2=split(/:/,$lines);
	   push(@date,$aj2[1]);
	   my($dd,$mm,$yy) =    (split(/\s/,$date[0]))[1,2,3];
	   push(@date1,"$dd");
           push(@month1, "$mm");
           push(@year1,"$yy");
         my($date2)= (join('-',@date1,@month1,@year1)); 
       print"$date2";
 }
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by ajay_p5
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.