FILE tag
Specifies a non-Analytics file, such as an Excel file, or a delimited file, that provides input for an analytic script running in Robots. The file must be located in the Input/Output tab in the same robot as the analytic script.
Syntax
//FILE filename <description>
Parameters
Name | Description |
---|---|
filename |
The name of the file in the Input/Output tab in Robots to use as input for an analytic script. Note The filename value must exactly match the name of the file in the Input/Output tab. filename cannot include a path. You can use wildcard characters in filename to assist with matching a name. You cannot use a variable for filename. Unsupported characters in the file nameDo not include any spaces in filename. Do not use any of the following characters in filename. They are not supported: < > : " \ / | Wildcard charactersWildcards are supported when specifying the file name. Use a single asterisk ( * ) to substitute for zero or more consecutive characters. For example:
|
description
optional |
Descriptive text about the non-Analytics file or other information. The description can be multiline, but it cannot skip lines. The description appears in the analytic header only and is not visible to end users in Robots. |
Examples
Basic examples
Specifies a specific file:
//FILE FlaggedAccounts.csv
Specifies all CSV files starting with "Flagged":
//FILE Flagged*.csv
Specifies all files:
//FILE *.*
Advanced examples
Import data from a related file
You run a monthly analysis of employee data contained in a delimited file that is manually uploaded to the Input/Output tab in Robots on a monthly basis. The analytic script in Robots imports the data from the delimited file to an Analytics table:
COMMENT
//ANALYTIC TYPE IMPORT employee_import
Imports employee records from a delimited file stored in the Input/Output tab.
//FILE Employees.csv
END
IMPORT DELIMITED TO Employees "Employees.fil" FROM "Employees.csv" 0 SEPARATOR "," QUALIFIER '"' CONSECUTIVE STARTLINE 1 KEEPTITLE FIELD "First_Name" C AT 1 DEC 0 WID 11 PIC "" AS "First Name" FIELD "Last_Name" C AT 12 DEC 0 WID 12 PIC "" AS "Last Name"
Remarks
To be used in a script, a non-Analytics file must first be imported into an Analytics table. Non-Analytics files cannot be used directly in a script.