Fortran Reading a file in FORTRAN 90 or 95

AI Thread Summary
The discussion revolves around a user seeking assistance with reading a text file in FORTRAN 90/95. The user aims to store each line of the file into separate string variables but encounters issues with the results from their current approach using "READ(1,*,IOSTAT=EOF) A." A member of the forum emphasizes the importance of providing actual source code, input samples, and results for effective troubleshooting. Ultimately, the original poster resolves the issue with help from a friend and expresses gratitude, indicating a willingness to provide more detailed information in future inquiries.
hamidsv
Messages
3
Reaction score
0
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
CS
DIRECT
1.2 2.5 3.6
1.6 -2.3 2.9
....
....
....
I need to put each line inside a string variable for example
A="CS"
B="DIRECT"
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.
 
Technology news on Phys.org
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.
 
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
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
8
Views
1K
Replies
12
Views
3K
Replies
5
Views
5K
Replies
5
Views
2K
Replies
1
Views
3K
Replies
1
Views
2K
Replies
16
Views
3K
Replies
33
Views
5K
Replies
2
Views
2K
Back
Top