Hi.I have a csv file name Relative which has 24 different data set containing characters as well as numbers. It looks likeDate,Hour,Min (RH),Max (RH),Avg (RH)2012-08-28,0,85.190,87.2012-08-28,1,85.390,88.570,86.775With reference to one of the thread reply in this forum,I wrote a fortran code to read the file which is as followsPROGRAM CSVREADCHARACTER(LEN=11)::DATEINTEGER: RREAL::MAX,MIN,AVGOPEN(FILE='RELATIVE',UNIT=15,STATUS='UNKNOWN')DO WHILE(.TRUE.)READ(15,.,END=123)DATE,HR,MIN,MAX,AVGWRITE(.,.)DATE,HR,MIN,MAX,AVGEND DO123 CONTINUECLOSE(15)END PROGRAM CSVREADThis program was successfully compiled but while executing its exe file no output in the terminal.
Archivos de tipo texto, que en el caso de FORTRAN, tienen la extensi´on:.f90,.f,.for, etc, y en el lenguaje de Programaci´on C, la extensi´on.c. Aunque muchas veces se usa lenguaje de programaci´on y lenguaje inform´atico como si fuesen sin´onimos.
READThe READ statement reads data from a file or the keyboard to items in the list.Note -Use the TOPEN routines to read from tape devices. See the Fortran Library Reference Manual.READ(UNIT= u , FMT= f ,IOSTAT= ios ,REC= rn , END= s , ERR= s ) iolistREAD f , iolist READ(UNIT= u, NML= grname ,IOSTAT= ios ,END= s ,ERR= s )READ grnameParameterDescriptionuUnit identifier of the unit connected to the filefFormat identifieriosI/O status specifierrnRecord number to be readsStatement label for end of file processingiolistList of variablesgrnameName of a namelist groupAn alternate to the UNIT= u, REC= rn form is as follows: @READ( u 'rn. ) iolistThe options can be specified in any order.DescriptionThe READ statement accepts the following arguments.Unit Identifieru is either an external unit identifier or an internal file identifier.An external unit identifier must be one of these:.A nonnegative integer expression.An asterisk (.), identifying stdin, normally connected to the keyboardIf the optional characters UNIT= are omitted from the unit specifier, then u must be the first item in the list of specifiers.Format Identifierf is a format identifier and can be:.An asterisk (.), indicating list-directed I/O. See for more information.A label of a FORMAT statement that appears in the same program unit.An integer variable name that has been assigned the label of a FORMAT statement that appears in the same program unit.A character expression or integer array specifying the format string.
This is called a runtime format or a variable format. The integer array is nonstandard.
@See for details on formats evaluated at runtime.If the optional characters, FMT=, are omitted from the format specifier, then f must appear as the second argument for a formatted read; otherwise, it must not appear at all.Unformatted data transfer from internal files and terminal files is not allowed, hence, f must be present for such files.List-directed data transfer from direct-access and internal files is allowed; hence, f can be an asterisk for such files. @If a file is connected for formatted I/O, unformatted data transfer is not allowed, and vice versa.I/O Status Specifierios must be an integer variable or an integer array element.Record Numberrn must be a positive integer expression, and can be used for direct-access files only. Rn can be specified for internal files. @End-of-File Specifiers must be the label of an executable statement in the same program unit in which the READ statement occurs.The END= s and REC= rn specifiers can be present in the same READ statement. @Error Specifiers must be the label of an executable statement in the same program unit in which the READ statement occurs.Input Listiolist can be empty or can contain input items or implied DO lists.