Reading ASCII Data

IDL recognizes two types of ASCII data files: free format files, and explicit format files. A free format file uses commas or tabs and spaces to distinguish each element in the file. An explicit format file distinguishes elements according to the commands specified in a format statement. Most ASCII files are free format files.

A Comma-Separated Values file (or CSV file) is a special type of ASCII file that uses the comma character to separate data files. Many spreadsheet programs can create CSV files to represent tabular spreadsheet data. You can use the READ_CSV routine to easily read this type of data, or simply select the CSV file after selecting Open from the IDL Workbench File menu.

Note
If you prefer not to use an interactive dialog (described below), you can also use the READ/READF, or READS procedures to access ASCII data. The READ procedure reads free format data from standard input, READF reads free format data from a file, and READS reads free format data from a string variable.

Launching the ASCII Template Dialog

The ASCII_TEMPLATE function launches a dialog that you can use to configure the structure of data in an ASCII file. Access this feature in one of the following ways:

Note
If you specify a Filename argument to ASCII_TEMPLATE, the dialog allowing you to browse to select a file will not appear. See "ASCII_TEMPLATE" (IDL Reference Guide) if you want specify a file and other parameters programmatically.

See Using the ASCII Template Dialog under "ASCII_TEMPLATE" (IDL Reference Guide) for instructions on how to use the dialog to define the structure of your ASCII data.