MathGroup Archive 1998

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

Search the Archive

Re: reading with ReadList



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.



  • Prev by Date: Re: reading with ReadList
  • Next by Date: Re: reading with ReadList
  • Prev by thread: reading with ReadList
  • Next by thread: Re: reading with ReadList