MathGroup Archive 1998

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

Search the Archive

Re: ReadList of Mixed Data Types???

"ToExpression" is also a technique I have used. In fact, I believe Todd
could read the comma delimited data as Words using ReadList with
WordSeparators->{","}, and then use ToExpression to convert the Words
to integers.

Unfortunately, this will not work for Reals expressed in Fortran
E-format. The problem is that while ReadList very conveniently
understands E-format, Mathematica in general does not, so neither does
ToExpression. I very frequently use Mathematica to process DOS text
format data files which have been stored by an HP semiconductor
analyzer, which really only wants to record comma delimited data.

What I *really* need is for ReadList to accept a WordSeperator->{","}
option when reading numbers - - - - but I would be very grateful to
anyone who could point me to a good work-around for this in Mathematica


Sean Ross wrote in message <6hrro5$h7c$>...
>Todd A. Guillory wrote:
>> I need to read this file into Mathematica:
>> George Washington
>> 1732,2,22
>> 1777,12,15
>> 1778,1,20
>> This is just a test, but the data file format HAS to be this way.   I
>> also have to use ReadList.  Don't ask!
>> Anyway, I've tried several variations of ReadList with WordSeparator and
>> such NEVER get all the data, just parts.
>> The first record is a string, the remaining three need to be 3-3 part
>> list of numbers.
>> Any suggestions greatly appreciated.
>> email
>I have also had trouble with ReadList, but I have a work around that has
>never failed me.  I read the entire data file in as a string using
>Read[stream,String].  I then use the string manipulation commands to
>massage it into the correct format and use ToExpression at the end to
>convert it into a numerical expression. --
>Remove the _nospam_ in the return address to respond.

  • Prev by Date: Re: what is wrong here?
  • Next by Date: Re: Mathematica 3.0.1 / Win95 woes
  • Prev by thread: Re: ReadList of Mixed Data Types???
  • Next by thread: How to plot list from (0,0) ?