Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Homework Help
Engineering and Comp Sci Homework Help
Fortran90: read file with variable name ( character)
Reply to thread
Message
[QUOTE="typeon, post: 3558227, member: 310516"] Hi there, I am trying to make a Fortran90 program that open files with this pattern: 1a041.dat wp2d2.dat qad33.dat mntf4.dat erh55.dat ...etc. so the first four digits I want to consider them as a variable character, then it comes an integer value that increases by one for every file. The last part is the ".dat" I don't know how to tell my program to read this character for every file and then to open it. I think I have managed to sort out the integer part by converting the integer value into a string value by using write(numchr,*) j. This is an extract of the program: PROGRAM database character(40) :: numchr ! this is to turn integer into string character(10) :: prot ! this is to read the first 4 digits integer :: j,n,i,k n = 10 DO j = 1,n write(numchr,*) j open (j, file = prot // trim(adjustl(numchr)) // ".dat",status='old') etc... close(j) ENDDO Many thanks! [/QUOTE]
Insert quotes…
Post reply
Forums
Homework Help
Engineering and Comp Sci Homework Help
Fortran90: read file with variable name ( character)
Back
Top