MathGroup Archive 2003

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

Search the Archive

reading variable names and values from a file

  • To: mathgroup at smc.vnet.net
  • Subject: [mg41518] reading variable names and values from a file
  • From: Chuck Wilkerson <cww at lanl.gov>
  • Date: Sat, 24 May 2003 01:03:36 -0400 (EDT)
  • Organization: University of Oregon
  • Sender: owner-wri-mathgroup at wolfram.com

Howdy!

I would like to read a text file that looks like the following:

a       1
b       2
c       3
...

and end up having assigned the value in the second column to the
variable name in the first column, i.e.

a=1
b=2
c=3
...

Does anyone know how to do this?  I have tried (only briefly, though)
with ReadList to accomplish this task, but with no success yet.

Thanks in advance!

-Chuck
-- 
=============================================================================
Chuck Wilkerson                                                  cww at lanl.gov
Advanced Diagnostics and Instrumentation Group               Tel 505-667-5966
Los Alamos National Laboratory                               FAX 505-665-2227
-----------------------------------------------------------------------------
You may ask yourself, 'What is that beautiful house?'
You may ask yourself, 'Where does that highway go to?'
You may ask yourself, 'Am I right?...Am I wrong?'
And you may say to yourself, 'My God, What Have I Done!?!'     -Talking Heads
=============================================================================
(Correspondence/TSPA)


  • Prev by Date: Re: 3D Data approximation
  • Next by Date: Re: TraditionalForm output and subscript variable
  • Previous by thread: Re: Syntax Error in File
  • Next by thread: ListSurfacePlot3D shades