read file from asci file

RadSurfer RadSurfer@yahoo.com
Fri Aug 10 23:04:00 GMT 2007


M. Kilani <mzmk2001 <at> yahoo.ca> writes:

> I have data in ascii file like this
> 
> name           value          description
> x                  2.3            var1
> y                  3.1            var...
> e                  2.5            ...
> 
> I want to write a function that reads data and affects values to variables.
> notice that the function should guess the name of the variable, and then
> affect the value, ie. the order of the variables may change.
[Snip]
> Moez

This does not look to difficult at all to me now that I've learned a few things
(with the help of the fine people here).

Since your variables appear to be flushed-right, reading their names is easy,
also given that they occupy the 1st of 3 columns also makes them easy to read,
2nd column values, 3rd column comment/description. No guessing required.

On a scale of easy-to-difficult, I would rank this problem "easy".

Freenode IRC server has a #fortran channel. If you would like to join us in
real-time IRC chat, you might be able to find some assistance there.
IRC is Internet Relay Chat, a free service available 24 hours a day. You
simply install an IRC Client, set it to Freenode server, and use
/j #Fortran, to join the channel.  Quick and easy.

//Rich//




More information about the Fortran mailing list