When importing files with the Import Wizard, you have the opportunity to identify file name or header information as variables. The extraction of the information can be customized in the Variable Extraction page. After the variables are extracted, they are saved in the target page for future use.
From the file name, four standard file name variables (path + filename.extension, path, filename.extension, filename) can be extracted. Additionally, all of the header lines ( the main header lines and subheader lines) can supply variables. You can specify the number of the header lines in the Number of main header lines box and the Number of subheader lines box in the Header Lines page of the Import Wizard.
Extracted variables are stored in the information storage object of the destination page. There are two areas where the variables can be saved:
These variables can be inserted into text labels or worksheet cells using the Insert Variables shortcut menu command. Variables can be listed from the command line using the impinfo X-Function or the following script command:
Note: Please see the Accessing Metadata Associated with Imported Files section later in this chapter for more information.
There are numerous ways in which you might use stored variable information in text annotations on graphs or worksheets. One possible use of this information might be to add it to a graph legend. In this example, assume that we have imported a data file in which we have specified saving some portion of the file name or header information to a variable and we will proceed to insert the file name into the graph legend.