MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to extract numbers from list elements with text?


Henning Heiberg-Andersen schrieb:
> Hi,
>
> I have a list looking like this:
>
> { 1 Intensity 0.23523,  2 Intensity 0.00005,  3 Intensity 0.00004, ..}
>
> Is there a command which allows extraction of only the last number appearing
> in each element
> of the list?. If not, how can I modify the list elements?
>
> Best regards,
>
> Henning Heiberg-Andersen
>
This seems to work:

ll=HoldForm[{ 1 Intensity 0.23523,
              2 Intensity 0.00005,  3 Intensity 0.00004}]

(ll /. n_. Intensity m_ -> m)//ReleaseHold

Out= {0.23523, 0.00005, 0.00004}

Gruss Peter
-- 
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: RE: sample programs
  • Next by Date: Functions inside list
  • Previous by thread: RE:How to extract numbers from list elements with text?
  • Next by thread: Re: How to extract numbers from list elements with text?