MathGroup Archive 2002

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

Search the Archive

Re: ReadList with mixed strings and numbers

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