| | |
joining more than 1 array
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Apr 2009
Posts: 19
Reputation:
Solved Threads: 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
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
Perl Syntax (Toggle Plain Text)
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"; }
![]() |
Similar Threads
- How can is see what button is pressed in a button array (VB.NET)
- troubleshoot char array; (C++)
- Dynamic array => dropdown issues... (PHP)
- passing a pointer/reference to array into a class (C#)
- joining array, but still read as number (ASP)
Other Threads in the Perl Forum
- Previous Thread: Basic parsing problem...Help plz
- Next Thread: Perl One Liner: Replace {(
Views: 442 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Perl





