Re: HELP - finding a float while reading a file

2002-01-04 Thread Sudarsan Raghavan
Nestor Florez wrote: > Hi there, > > I am trying to read a file and find the last numeric value in the line read. > example: > 123 45 -23 56 <-3.45 > 145 555 112 -12.0 -2.55 > > all of the values are separated by a space and I am looking for the last > value. > I tried If you know that the valu

RE: HELP - finding a float while reading a file

2002-01-04 Thread John Edwards
tch the end of the string, so the match found must appear at the end of the string of data. This is probably where you were going wrong before. HTH John -Original Message- From: Nestor Florez [mailto:[EMAIL PROTECTED]] Sent: 04 January 2002 02:26 To: [EMAIL PROTECTED] Subject: HELP - fi

HELP - finding a float while reading a file

2002-01-04 Thread Nestor Florez
Hi there, I am trying to read a file and find the last numeric value in the line read. example: 123 45 -23 56 <-3.45 145 555 112 -12.0 -2.55 all of the values are separated by a space and I am looking for the last value. I tried $_ = s/[-][0-9].+$/$1/; $number = $1; The problem is that, not a