Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: removing letters from alphanumeric data

  • To: mathgroup at smc.vnet.net
  • Subject: [mg48398] Re: [mg48377] removing letters from alphanumeric data
  • From: János <janos.lobb at yale.edu>
  • Date: Fri, 28 May 2004 00:50:25 -0400 (EDT)
  • References: <200405260641.CAA24237@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On May 26, 2004, at 2:41 AM, Charles Koehler wrote:

> Hello,
>
> I am able to find and read in from a data header a particular variable
> value, my difficulty is in my attempt to drop the letters that follow
> the number I need to retrieve.
>
> For example, I'll use Find to locate the position of the variable
> "Temperature" and then store the value that follows it, however there
> is generally a "C" or something after the temperature value, e.g.
> "45C".  All I need is the value 45.

My newbie approach:

alnum = "45C"

45C

StringJoin[Map[ToString, Select[ToExpression[Characters[alnum]], 
NumericQ]]]

45

János
>
> Also, If there is no entry at all is there a way to put a placeholder
> value in it place, instead a Null.
>
> Sincerely,
>
> Charles Koehler
>
>
----------------------------------------------------------
"A cyber virgin has never had intercourse outside of virtual reality, 
whereas a virtual virgin has never had intercourse with a real person 
even in virtual reality"

-Ray Kurzweil - "The age of spiritual machines"


  • Prev by Date: Re: Eigensystem: different solution in V5.0 and V4.1 [SOLVED: BUG in 5.0]
  • Next by Date: Manipulating notebooks. Request for examples
  • Previous by thread: removing letters from alphanumeric data
  • Next by thread: RE: removing letters from alphanumeric data