TPoly
asked on
perl code
hi..
i have this statment in the perl script that allows me to extract the date "02/31/04"
and insert it to the database in the form of "2004/02/31"
this is the statment :
if( /Start Date\s*:\s*(\S+)/ ) {
$job = $1;
($date = $2) =~ s!(\d\d)/(\d\d)/(\d\d)!20$ 3/$1/$2!;
however, the date formate given is in this form "thur jul 22 10:10:18 2004"
how do i modify the above statment to extract onlt "jul 22 2004"
thanks.
i have this statment in the perl script that allows me to extract the date "02/31/04"
and insert it to the database in the form of "2004/02/31"
this is the statment :
if( /Start Date\s*:\s*(\S+)/ ) {
$job = $1;
($date = $2) =~ s!(\d\d)/(\d\d)/(\d\d)!20$
however, the date formate given is in this form "thur jul 22 10:10:18 2004"
how do i modify the above statment to extract onlt "jul 22 2004"
thanks.
s/\w+\s+(\w+)\s+(\d+)\s+\d \d:\d\d:\d \d\s+(\d\d \d\d)/$1 $2 $3/;
ASKER
hi ozo,
i tried the statement you have provided but it only extract "thur" and
insert it into the database.
i tried the statement you have provided but it only extract "thur" and
insert it into the database.
ASKER
sorry..
my mistake i want to modify the above perl statement from
"thur jul 22 10:10:18 2004" to "2004/07/22"
my mistake i want to modify the above perl statement from
"thur jul 22 10:10:18 2004" to "2004/07/22"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi ozo. the state ment work,
however it is unable to insert the date into the database and
also i have have duplicate dates but i have many text files
with different date.
however it is unable to insert the date into the database and
also i have have duplicate dates but i have many text files
with different date.