Re: How to plot a date file? Some questions, some solutions.
- To: mathgroup at smc.vnet.net
- Subject: [mg4868] Re: How to plot a date file? Some questions, some solutions.
- From: "Richard L. Bowman" <rbowman at bridgewater.edu>
- Date: Thu, 26 Sep 1996 22:42:23 -0400
- Organization: Bridgewater College
- Sender: owner-wri-mathgroup at wolfram.com
Here is code I used to read in your data file. It did not seem to want to be read in as numbers, so I read it as a string (Word) and then wrote it out in a format that I knew Mathematica could read. It seems cumbersome, but it works. I, too, have had difficulty reading in data files generated by other programs at times, so I hope this will help. I copied your data file to a file called "temp-data", so replace the file names as you wish. _Mma Code_ stream = OpenRead["temp-data"] data = ReadList[stream, Word, TokenWords->{"R ","DG","FQ",","}, RecordLists->True, RecordSeparators->"\n"] Close[stream] fd = Table[{data[[i,2]],data[[i,5]],data[[i,8]]}, {i,Length[data]}] WriteString["temp-data-rev", TableForm[fd]] stream = OpenRead["temp-data-rev"] data = ReadList[stream, Number, RecordLists->True, RecordSeparators->{"\r","\n"}] Close[stream] ------------------------------------------------------------------------- Dr. Richard L. Bowman, Chair Dept. of Physics e-mail: rbowman at bridgewater.edu Bridgewater College phone: 540-828-5441 Bridgewater, VA 22812 FAX: 540-828-5479 "http://www.bridgewater.edu/departments/physics/bowman/bowman.html" ------------------------------------------------------------------------- ==== [MESSAGE SEPARATOR] ====