|
WRITE ROWName:
Sometimes you may encounter data files that are row oriented, that is rows denote variables while columns denote observations. This is often the case when the number of variables is significantly greater than the number of observations. The READ ROW command was added to accomodate these types of files. Often these row-oriented files will contain a large number of rows and take a long time to read. Typically, you cannot use the SET READ FORMAT command on these files to speed up the read. The WRITE ROW command was added in order to allow you to create a version of the row oriented file that can be read using the SET READ FORMAT with the READ ROW command. This speed-up can be on the order of a factor of 10 to 20. The downside is that the new file is typically larger than the original file. The WRITE ROW command is only supported for numeric variables.
where <var-list> is a list of variable names to write. This syntax is used to write to the terminal or from within a macro file. In practice, WRITE ROW is not typically used for terminal writes. However, it does work.
where <file> is the name of the file where the data resides; and <var-list> is a list of variable names to write. This syntax is used to write to a file. The WRITE ROW is often used when there are a large number of variables. The TO syntax is supported for this command which is useful when there are a large number of variables to write.
WRITE ROW FILE.DAT Y1 TO Y100
File names have the following restrictions:
As a further caution for Unix/Linux hosts, certain expansion characters (specifically ~ to refer to your home directory) are interpreted by the shell and are not recognized by the Fortran compiler. These expansion characters are interpreted as literal characters and do not yield the intended file name.
skip 25 read berger1.dat y x batch . set write format 107F10.4 write row berger1_row.dat y x batch
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 10/15/2018 |