Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*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 2001

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

Search the Archive

Re: reading data files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31890] Re: [mg31880] reading data files
  • From: BobHanlon at aol.com
  • Date: Mon, 10 Dec 2001 06:14:29 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 12/9/01 7:24:05 AM, christophe.leponcin-lafitte at obspm.fr 
writes:

>I want to realize an input file for a Mathematica program, which has the
>form :
>-------
>datafile1="toto.dat"
>
>datafile2="toto2.dat"
>
>parameter1=10
>
>parameter2=0.05
>-----
>For this time, I use an input file like :
>-----
>"toto.dat"
>"toto2.dat"
>10
>0.05
>-----
>In reality, the input file contains 35 data files, and 92 parameters.
>But, when a person want to read or modify the input file, he doesn't 
>know which parameter he changes ! This is only a list of number and 
>string !
>
>So, how to import in Mathematica the lign, datafile1="toto.dat" or 
>parameter1=10, and keep only the information "toto.dat" or 10 in a 
>variable of the main program.
>

Clear[datafile1, datafile2, parameter1, parameter2];

ToExpression /@ ReadList["Macintosh HD:Documents:temp:datafile.txt", String];

{datafile1, datafile2, parameter1, parameter2}

{toto.dat,toto2.dat,10,0.05}


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: I Need advice on converting Mathematica files to JPEGS or Bitmaps
  • Next by Date: Re: Simple questions about Mathematica
  • Previous by thread: reading data files
  • Next by thread: Mathematica tensor product