Help with code = Extract numerical value to variable

Peter Pearson ppearson at nowhere.invalid
Thu Oct 22 20:16:17 CEST 2009


On Thu, 22 Oct 2009 10:27:57 -0700 (PDT), Steve wrote:
> I have some data that I'm performing some analysis on.
> How do I grab the numerical value if it's present and ignore
> otherwise. So in the following example
> I would have assign the following values to my var
> 16
> 20
> 2
> 7
> 0
>
>
> In Field6
> Sample String data is
> sold: 16
> sold: 20
> sold: 2
> sold: 0
> sold: <storefront>
> 7
> 0
><storefront>
> sold
> null

What result do you want from these lines:
sold: 1 2 3
sold: 123x 4
sold: 5 y 6
sold: 3-2
sold: 3 - 2
sold: -3
sold: 1.5
sold: 1e6
sold: 2*2

-- 
To email me, substitute nowhere->spamcop, invalid->net.



More information about the Python-list mailing list