![]() |
READ 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 better accomodate these types of data files. With the ROW READ the file is read one row at a time and each row is added as a Dataplot variable. Only a single variable name is given to READ ROW command. This name serves as the "base name". So if Y is the variable name given and there are 25 rows of data, variables Y1, Y2, ..., Y25 will be created by the READ ROW command. The READ ROW command is only supported for numeric data. However, the rows do not need to contain the same number of data values. If the maximum number of available columns is reached, the READ ROW command will be terminated. However, any rows that have already been successfully read will still be retained. If there in error in reading a specific row, that row will be skipped and Dataplot will go to the next row. The READ ROW command generates a limited amount of feedback. It prints feedback for the first row read and the last row read only. If you want to see what variable names were created, you can enter the command
where <y> is the base name for the variables being read. This syntax is used to read from the terminal or from within a macro file. All lines are read until an END OF DATA is encountered. In practice, READ ROW is not typically used for terminal reads. However, it does work.
where <file> is the name of the file where the data resides; and <y> is the base name for the variables being read. This syntax is used to read from a file. All lines are read until an END OF DATA is encountered, the physical end of file is encountered, or the maximum number of variables is reached.
Note that Fortran formats are based on the decimal point lining up consistenly between rows. Spreadsheet programs such as Excel tend to generate either right justified or left justified columns when generating fixed width ASCII files. These are typically not consistent with Fortran formatted reads.
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.
The primary use for this option is if you have a large data file that you will be accessing frequently. In this case, it can speed up the I/O to save a binary version of the file (you should keep the original ASCII version). For details, enter HELP SET READ FORMAT.
READ ROW Y 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 END OF DATA SET WRITE DECIMALS 0 PRINT Y1 Y2The following output is returned ------------------------------ Y1 Y2 ------------------------------ 1 16 2 17 3 18 4 19 5 20 6 21 7 22 8 23 9 24 10 25 11 0 12 0 13 0 14 0 15 0
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 10/15/2018 |