The READ_ASCII function reads data from an ASCII file into an IDL structure variable. READ_ASCII may be used with templates created by the ASCII_TEMPLATE function.
This routine handles ASCII files consisting of an optional header of a fixed number of lines, followed by columnar data. One or more rows of data constitute a record . Each data element within a record is considered to be in a different column, or field . The data in one field must be of, or promotable to, a single type (e.g., FLOAT). Adjacent fields may be collected into multi-column fields, called groups . Files may also contain comments, which exist between a user-specified comment string and the corresponding end-of-line.
READ_ASCII is designed to be used with templates created by the ASCII template function.
This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
You can define the attributes of a field in two ways. If you use a template, you can either use a previously generated template, or create a template with the ASCII_TEMPLATE function on page ASCII_TEMPLATE . You can use COMMENT_SYMBOL, DATA_START, DELIMITER, or MISSING_VALUE to either override template attributes or to provide one-time attributes for the file to be read, without a template.
Set this keyword to a string that identifies the character used to delineate comments in the ASCII file to be read. When READ_ASCII encounters the comment character, it discards data from that point until it reaches the end of the current line, identifying the rest of the line as a comment. The default character is a space, ` ', specifying that no comments will be recognized.
Set this keyword to a string that identifies the end of a field. If no delimiter is specified, READ_ASCII uses information provided by the template in use. The default is a space, ` ', specifying that an empty element constitutes the end of a field.
Use this keyword to specify the ASCII file template (generated by the function ASCII_TEMPLATE ), that defines attributes of the file to be read. Specific attributes of the template may be overridden by the following keywords: COMMENT_SYMBOL, DATA_START, DELIMITER, MISSING_VALUE.