Hi I am ABHI
i want to substitute 19-13-10-456765
to 19*10 + 13*5 + 10
is equal to (265)
in file
i want to know the exact code to do that
this is the file content xyz.txt
19-10-13-400922 TID1-3039 1RequestREGISTER
19-10-13-405432 TID1-3039 1Response100
19-10-13-410015 TID1-3039 1Response401
19-10-13-415481 TID1-3039 2RequestREGISTER
19-10-13-419800 TID1-3039 2Response100
19-10-13-426400 TID2-3039 1RequestREGISTER
19-10-13-463320 TID3-3039 1RequestREGISTER
19-10-13-514112 TID4-3039 1RequestREGISTER
here my code but i dont know where i m doing mistake ,,,plz your early help welcome
#!perl -w
use strict;
use warnings;
open(INPUT, "<time.txt");
while (<INPUT>) {
s/(\d\d)-(\d\d)-(\d\d)-(\d\d\d\d\d\d)/ $1*3600 + $2*60 + $3/e;
##print OUT "$n: $line";
}
close INPUT;
thanks in advance