DC_READ_FIXED Function

Reads fixed-formatted ASCII data using a format that you specify.

Usage

Input Parameters

Output Parameters

Returned Value

Keywords

$BLANK_LINES Skip all blank lines; this prevents those lines from being interpreted as a series of zeroes.
$TEXT_IN_NUMERIC Skip any line where text is found in a numeric field.
$BAD_DATE_TIME Skip any line where invalid date/time data is found.

Discussion


NOTE: This function can be used to read data into date/time structures, but not into any other kind of structures.

String Resources Used By This Function

How the Data is Transferred into Variables


TIP: If an error does occur, use the PRINT command to view the contents of the variables to see where the last successfully read value occurs. This will enable you to isolate the portion of the file in which the error occurred.

Format Reversion when Reading Data

Physical Records vs. Logical Records


NOTE: The Nrecs keyword counts by logical records, if they have been defined. The Nskip keyword, on the other hand, counts by physical records, regardless of any logical record size that has been defined.

Changing the Logical Record Size


NOTE: By default, DC_READ_FIXED considers the physical record to be one line in the file, and the concept of a logical record is not needed. But if you are using logical records, the physical records in the file must all be the same length. The Bytes_Per_Rec keyword can be used only with column-oriented data files.

Filtering and Substitution While Reading Data


NOTE: If you want to supply multi-character strings instead of individual characters, you can do this with the Ignore keyword. However, keep in mind that a character that matches Filters is simply discarded, and filtering resumes from that point, while a string that matches Ignore causes that entire line to be skipped.

Missing Data Substitution

Reading Row-Oriented Files

Reading Column-Oriented Files

Multi-dimensional Variables

Dimensions of Variable How Data is Read From the File(If Variable is Pre-dimensioned)
One-dimensional(1 x n) One value read from each record of file(repeated n times)
Two-dimensional(m columns by n rows) m values read from each record of file(repeated n times)
Three-dimensional(m x n x p) m values read from each record of file(repeated n times) (entire process repeated p times)
q-dimensional(m x n x p x q) m values read from each record of file(repeated n times)(above process repeated p times)(entire process repeated q times)


NOTE: If you want to intermingle multi-dimensional variables in var_list, you must be sure that the product of all dimensions (excluding the first dimension) of each variable is equal. For example, you can combine two-, three-, and four-dimensional variables in var_list if the variables have dimensions like these:

Example 1

Example 2

Example 3

Example 4

Example 5


TIP: Only include the Bytes_Per_Rec keyword when you have a logical record that is longer or shorter than one line in the file. For the majority of column-oriented data files, one and only one value from each variable is on a single line, and the Bytes_Per_Rec keyword is completely unnecessary.

Example 6

Number Template Description




NOTE: Because of the internal conversion that DC_READ_FIXED performs to convert the date strings to PV-WAVE's date/time internal structure, the date and time data must be read with the A8 (FORTRAN) or %8s (C) format string.

Example 7

See Also





doc@boulder.vni.com
Copyright © 1999, Visual Numerics, Inc. All rights reserved.