Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Reading a file in FORTRAN 90 or 95

  1. May 28, 2012 #1
    Hi everybody,
    I need your help guys. I am using FORTRAN 90(or 95) and try to read a text file. The file contains many lines for instance something like this
    1.2 2.5 3.6
    1.6 -2.3 2.9
    I need to put each line inside a string variable for example
    C ="1.2 2.5 3.6 "
    Please if you know the answer just let me know. I use "READ(1,*,IOSTAT=EOF) A" but the result is totally different.
  2. jcsd
  3. May 29, 2012 #2
    Hi, hamidsv:

    When it comes to source code, input and results, hand waving does not cut it; please post the actual source code that you are using, an actual sample of the input and the actual results that you are getting...there is no point in trying to help you when you tell us what YOU think what you are doing but the sources say something else.
  4. May 31, 2012 #3
    Hi gsal,
    Thanks for your quick reply. This time I was able to solve the problem (one of my friends helped me). Next time I try to provide all information if I have any questions.
    Thanks again
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Reading file FORTRAN Date
Fortran Reading data from a table file Dec 29, 2016
Fortran: reading the data from file Mar 11, 2016
Fortran 95 read statement Oct 9, 2015
Facing issue in reading grib file from fortran 90 code Sep 24, 2014