Re: How to extract numbers from list elements with text?
- To: mathgroup at smc.vnet.net
- Subject: [mg70359] Re: How to extract numbers from list elements with text?
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Sat, 14 Oct 2006 03:06:58 -0400 (EDT)
- References: <egn9a3$1em$1@smc.vnet.net>
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