Re: stripping characters from a variable

2002-12-12 Thread Wiggins d'Anconia
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

RE: stripping characters from a variable

2002-12-12 Thread Timothy Johnson
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

RE: stripping characters from a variable

2002-12-12 Thread Mark Anderson
> 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