Re: reading with ReadList
- To: mathgroup@smc.vnet.net
- Subject: [mg10300] Re: [mg10282] reading with ReadList
- From: seanross@worldnet.att.net
- Date: Mon, 5 Jan 1998 03:47:20 -0500
- References: <199801040424.XAA26368@smc.vnet.net.>
C.OSBORNE wrote: > > I am having difficulties reading a list of data into Mathematica. I have > two copies of the data file in different directories. the first copy is > in a directory called "crap" (which I use for testing code etc) and the > second copy is several directories down. > > when I use the line: > csat=Table[ReadList["c:\crap\csat9070.dat",Number,RecordLists->True]] > > the data is read-in fine. > > when I use the line: > > csat2=Table[ReadList["c:\craigd\almgna\morbplen\5510\csat9070.dat",Number,Re > cordLists->True]] > > I get "$Failed" > > I have checked the path and also that the files are identical. > > Does anyone know what I am doing wrong ? > > Thanks in advance A good standard programming practice is to always type in strings in their own cell and execute the cell to make sure that there are no control characters embedded. In your case \5510 is some kind of a control character that appears as a darked in box on my system. Replacing \5510 by \\5510 returns a string with the path name as you expect. Other control characters are \t for tab and \n for return, so that the string "c:\newstuff\trueblue" gets interpreted as: c: ewstuff rueblue so you need to use "c:\\newstuff\\trueblue" which returns c:\newstuff\trueblue -- Remove the _nospam_ in the return address to respond.
- References:
- reading with ReadList
- From: "C.OSBORNE" <COSBORNE@GLOBALNET.CO.UK>
- reading with ReadList