Re: ReadList of Mixed Data Types???
- To: mathgroup@smc.vnet.net
- Subject: [mg12055] Re: [mg12011] ReadList of Mixed Data Types???
- From: Sean Ross <seanross@worldnet.att.net>
- Date: Fri, 24 Apr 1998 01:52:26 -0400
- References: <199804170740.DAA00258@smc.vnet.net.>
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 tag@io.com 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.
- References:
- ReadList of Mixed Data Types???
- From: "Todd A. Guillory" <tag@io.com>
- ReadList of Mixed Data Types???