USETXT

Purpose

Indicate name of a text input file that has variable names in the first line.  Typically such a file will be a comma-separated-value (CSV) file created by a spreadsheet or exported from some other program.

Syntax

USETXT fname @

Arguments and Subcommands

fname

Name of the input text file

Remarks

The first line of the input file is assumed to contain a list of variable names.  Typically the names are separated by commas but they can also be separated by tabs or even spaces (though this has some limitations).  If there are two (non-space) separators in a row then it is assumed that this variable will be skipped when reading the data from the file.

When this command is given the header is read and used to determine the names of the input variables however, as with the USE command for BSF files, the data are not read until the INPUT @ is given.   Thus, you can specify transformations prior to input of the data.

Example

Read data from a file CSV file with variable names in the first row, defining transformations prior to reading the data.

USETXT mydata.csv @
TRAN bdate = fracymd(byr,bmo,dby) @

INPUT @