Improve this answer. Thanks for your very helpful answer and comments. In the last line, I replace name with file. I tried and then it works! Oh, sorry. Corrected that now. Add a comment. Fortranner Fortranner 2, 1 1 gold badge 17 17 silver badges 24 24 bronze badges.
The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. It is the file access mode. It gives the formatting status of the file. After the file has been opened, it is accessed by read and write statements.
Once done, it should be closed using the close statement. When the above code is compiled and executed, it creates the file data1. And then closes the file. The read and write statements respectively are used for reading from and writing into a file respectively. Learn more. Looping over variable file names [duplicate] Ask Question.
Asked 8 years, 8 months ago. Active 8 years, 8 months ago. Viewed 12k times. Improve this question. Vijay Vijay 5 5 gold badges 12 12 silver badges 26 26 bronze badges. It looks like you would be interested in this question: stackoverflow. Add a comment. Active Oldest Votes. Something like this: edited to have unit numbers 31 to 34, filenames 1 to 4.
Improve this answer. While the unit numbers are 31 to 34, the filenames are "set1", Thank you for the help. But I am getting error if the number in set go beyond 9. For example, if the number become "set10", the program stop running.
0コメント