Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: ReadList with mixed strings and numbers

  • To: mathgroup at
  • Subject: [mg34859] Re: [mg34813] ReadList with mixed strings and numbers
  • From: Rolf Mertig <rolf at>
  • Date: Tue, 11 Jun 2002 05:00:22 -0400 (EDT)
  • Organization: Mertig Consulting
  • Sender: owner-wri-mathgroup at

one possibility is:

MixedRead[str_String, numformat_:{Number, Number}] := Block[{f, numcheckQ},
        f = ReadList[str, String];
        numcheckQ = (Complement[Characters[#],
          "+","^"," ",".", "\n","\r","\t"}     ] === {} )&;
        Read[StringToStream[f[[i]]], numformat], f[[i]]], {i, Length[f]} ] ]

Dr. Rolf Mertig
Mertig Consulting, Berlin, Germany
(web)Mathematica Programming and Training

  • Prev by Date: inverse square law attraction
  • Next by Date: Re: Does Mathematica runs in Windows XP?
  • Previous by thread: ReadList with mixed strings and numbers
  • Next by thread: Sorting with absolute precision