MathGroup Archive 1997

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

Search the Archive

ReadList and FortranForm data

  • To: mathgroup at
  • Subject: [mg8426] ReadList and FortranForm data
  • From: Sean Ross <seanross at>
  • Date: Sat, 30 Aug 1997 00:42:34 -0400
  • Sender: owner-wri-mathgroup at

I have never been able to figure out how to read in data from a text
file that is separated by spaces with return characters at the end of
each line.  ie

1 2 3 4
5 6 7 8

The big problem is that Mma interprets the spaces as multiplication
operators.  I have tried specifying spaces as WordSeparators,
RecordSeparators, but have not been successful.  My work-around is to
read the whole thing in as a String using the Word option, then manually
put commas in where the spaces were and use ToExpression to convert to
numbers again.  Unfortunately, this method fails with Fortran-like data
since the e-01 are interpreted as exponentials.  Can someone give me the
syntax to read in space separated data please.

  • Prev by Date: Re: Sum[1/(n^2 +n+1)^2,{n,1,p}]
  • Next by Date: ASCII Input File Size Limitations
  • Previous by thread: Re: Simplifying Sqrt[a^2*d^2]
  • Next by thread: ASCII Input File Size Limitations