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
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
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