perldoc -f substr
http://danconia.org
Jose Malacara wrote:
Hello. I have a logfile in which every message begins with a timestamp (ex. - 20012091500). I would like to be able to remove the last 4 characters (1500) off each of these to derive the date only (2001209). It works by chopping of each
You can try something like this:
if($ts =~ /^(\d{8})/){ #get eight sequential digit chars
print "$1\n";
}else{
print "Time stamp format invalid!\n";
}
-Original Message-
From: Jose Malacara [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 4:26 PM
To: [EMAIL PR
> Hello. I have a logfile in which every message begins with a timestamp
(ex. - 20012091500). I would like to be able to remove the last 4 characters
(1500) off each of these to derive the date only (2001209). It works by
chopping of each character individually, but I would like to know if there
is