Re: Pattern Search and Extraction of Floating Point number to csv file

From: Brad Baxter (bmb_at_ginger.libs.uga.edu)
Date: 07/15/04


Date: Thu, 15 Jul 2004 12:16:35 -0400

On Thu, 15 Jul 2004, Ram Laxman wrote:

> The statement below extracts the numerical field.
> if( $afield =~ /(\d+)/
>
> I don't know how to extract the floating point numbers.(For example
> Data exchanged with device = 0.5 bytes) without truncation and
> want to save the same value in my csv file.
>
> Could anybody help me in this regard?

Perhaps one of the regex in:

    perldoc -q 'whether a scalar is a number'

Regards,

Brad



Relevant Pages