Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: reading from file

  • To: mathgroup at
  • Subject: [mg80197] Re: reading from file
  • From: Bill Rowe <readnewsciv at>
  • Date: Tue, 14 Aug 2007 07:15:20 -0400 (EDT)

On 8/13/07 at 4:27 AM, jsheinwald at (Jesse Sheinwald)

>This is an example of reading from a file that I took from the book
>"An Introduction to Programming with Mathematica"  by Wellin.  The
>author provides data for a number of examples and the reader is
>instructed to store this date either in the BaseDirectory or the

Did you do this? That is did you create the indicated directory
and copy the file to it?
If you didn't then doing

>I entered the Mathematica code (v6) as this with
>the programs response...

>datafile = ToFileName[{$BaseDirectory, "Applications", "IPM3",
>"DataFiles"}, "dataset.m"]


>C:\Documents and Settings\All Users\Application
>Data\Mathematica\Applications\ \IPM3\DataFiles\dataset.m

>data = Import[datafile, "Table"]


will result in an error since the file and directory won't
exist. ToFileName constructs a valid path regardless of whether
the file and directory exist or not.
To reply via email subtract one hundred and four

  • Prev by Date: Re: question
  • Next by Date: Re: Foucault pendulum
  • Previous by thread: Re: reading from file
  • Next by thread: Re: [TS 20904]--Re:numbered lists problem