Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

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

Search the Archive

Re: ReadList Expression: (Q)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3708] Re: ReadList Expression: (Q)
  • From: wagner at bullwinkle.cs.Colorado.EDU (Dave Wagner)
  • Date: Wed, 10 Apr 1996 02:11:33 -0400
  • Organization: University of Colorado, Boulder
  • Sender: owner-wri-mathgroup at wolfram.com

In article <4ka4vs$sai at dragonfly.wolfram.com>,
m. r. schaferkotter <schaferk at communique.net> wrote:
>greetings:
>
>HDF files will output Inf for very large values.
>
>my data file looks like:
>
>-.022 .033
>Inf   -Inf
>
>How can one read this into Mma? 

    ToExpression /@ ReadList[Word] should do it.

If you want maintain the structure of the file, the easiest thing to do
is use Partition after you've finished reading.   If the file may have
a different number of entries on each line, then you can't afford to lost
the structure in the first place.  In that case you can do this:

    Map[ToExpression, ReadList[Word, RecordLists->True], {2}]

		Dave Wagner
		Principia Consulting
		(303) 786-8371
		dbwagner at princon.com
		http://www.princon.com/princon

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: argument names
  • Next by Date: MathLink and C++ (can mathlink handle C++?)
  • Previous by thread: ReadList Expression: (Q)
  • Next by thread: Solaris and CDE