• HOME
  • PUBLICATIONS
  • RESEARCH INTERESTS
  • CONTACTS
  • Teaching
  • RANDOM WORDS
  • FORTRAN .... OF COURSE!
  • Contents (Fortran)
go back to the content section

Characters & Strings: generating data files on demand

Creative Commons License
Tutorials on Fortran by www.giuseppeforte.me is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

    Join The Fortran Newsletter

Subscribe to Newsletter
In this example I introduce the usage of characters and strings. In particular, I discuss how to use character variables to generate new data files on demand (for example within a cycle). Such technique could be extremely useful. Indeed, is practically impossible to define data files by hand, when the number of such data files is huge. 
EXAMPLE - III:  automatic generation of data - files​
In this example:
  • Character declaration
  • Strings concatenation
  • How to write (convert) an integer number in a string, using a given format  
  • how to trim and adjust the length of an already defined character variable ​
In addition to the previous points, specifically related to the usage of character variables, in this example you will also learn how to redirect  all the outputs on the screen in an external file
go back to the content section
Download the Source code (it is free, just have fun!). 
In order to compile and run the source code given in the attached Listing, refer to the instructions in section before starting
files_on_demand.pdf
File Size: 7310 kb
File Type: pdf
Download File

listing1_3.f
File Size: 6 kb
File Type: f
Download File

  • HOME
  • PUBLICATIONS
  • RESEARCH INTERESTS
  • CONTACTS
  • Teaching
  • RANDOM WORDS
  • FORTRAN .... OF COURSE!
  • Contents (Fortran)