Read File |
The Read File action looks in a specified folder for a defined file type, reads the data that is contained in that file, and then saves the data to a variable.
You can configure the properties for the Read File action on the following tabs.
Source
Location: Specifies the file system in which the source folder exists. File systems or locations can include local file systems or network shares, Librarian, or a supported cloud storage location. For more information about supported cloud storage locations, refer to the Administration Console
File Name: Specifies the file that the action reads from. You can enter the folder location and file name or click Browse to locate and then select the file that you want. Alternatively, you can add a variable to specify the file that you want or add a special character to the value that you enter.
|
If you clicked to select the Wait for file to arrive check box under File Detection (as follows), the File Name option changes to the Folder to Scan option. |
Folder to Scan: Specifies the folder location where you want the action to look for the file. You can enter the folder location or click Browse to locate and select the folder that you want. Alternatively, you can add a variable that specifies the folder to scan or add a special character to the value that you enter. Available when you click to select the Wait for file to arrive check box under File Detection.
Scan child folders: Specifies that the action also monitors all the subfolders of the folder that is specified by the Folder to Scan property.
File Encoding: Specifies the method that is used to encode the file that is being read.
File Content Format: Specifies the data content type. The action processes the contents of the file according to this format.
Data is contained in a SOAP message: Specifies that the action looks for the data to be contained in a SOAP message.
Locked-File Timeout: Specifies how long to attempt to open the file that is found to be initially locked by another application.
File Detection
Wait for file to arrive: Specifies that the action waits for the file to arrive if it does not already exist in the folder.
|
File detection options are available only when you click to select the Wait for file to arrive check box. |
Detection Options
Scan Method: Specifies the method that the action uses to monitor the scan folder for the arrival of the specified file.
Notification and Polling: Specifies that the action monitors the scan folder continuously and also scans it at timed intervals. This option is useful when you have concerns about the reliability of your file system. If a continuous scan missed an event, a polled scan would ensure that it was detected. When you select this option, you can specify the polling interval in milliseconds, seconds, minutes, or hours.
Notifications Only: Specifies that the action monitors the scan folder continuously.
Polling Only: Specifies that the action scans the scan folder at timed intervals. When you select this option, you can specify the polling interval in milliseconds, seconds, minutes, or hours.
Polling Interval: Specifies how often the action scans for the file. Available when Notification and Polling or Polling Only is selected for the Scan Method.
File Pattern: Specifies the filter that the action uses to identify the file on which you want the action to be run. This filter can include wildcard characters (such as ? and *) or regular expressions (such as (?i)^.*\.csv$). Click to view a list of supported regular expression or wildcard modifiers, and then click a modifier to add it. You can also add a variable that specifies the file pattern or add a special character to the value that you enter.
Use Regular Expression: Specifies that the action uses regular expressions to identify the file pattern. When you select this option, you can add regular expression modifiers to the previous property for more control over the search criteria.
Minimum File Size: Specifies the minimum file size that the file must be for the action to accept it as the source file.
Maximum File Size: Specifies the file size that the file cannot exceed for the action to accept it as the source file.
File Idle Time: Specifies the maximum time a file can be idle in the specified folder for the action to still accept it as the source file. The maximum idle time can be specified in milliseconds, seconds, minutes or hours, and is compared against the file's "LastModifiedTime" property.
Multiple File Sort Order
Defines the order in which the action processes files in the specified folder when more than one file matches the indicated file pattern. If no sort order is specified on the property page, the sorting process defaults to creation time (in ascending order) and then file name (in ascending order). You can specify up to four sort criteria.
Order: Displays the order in which the sort criteria are applied to the matching files in the specified folder.
Sort Field: Specifies the criterion to be applied to the matching files.
Direction: Specifies whether ascending or descending order is used when the sort field criterion is applied to the matching files.
Add Sort Criteria: Specifies additional sort criteria.
Output
Save file contents to variable: Specifies the variable to which you want to save the file contents. Enter the variable in the input box. Alternatively, you can add a variable.
Action
Name: Specifies the name of the action. You can replace the default name by entering a new name in the field.
Description: Specifies a description for the action.
Run Action: Specifies how often you want the action to run.
Always: Specifies that the action runs each time the event occurs.
Never: Specifies that the action does not run when the event occurs.
Conditionally, based on variable: Specifies that the action runs only when a selected variable meets a specified condition. Use this option in situations in which there is only one condition that determines whether the action runs. After you select this option, you can create the conditional statement in the input box.
Variable: Specifies the variable that you want to use for the conditional statement. Enter the variable in the input box. Click to see a list of recently used variables or click More Variables to open the Insert Variable dialog.
[Relational Operator]: Specifies the relational operator to use for the conditional statement. Click the existing operator to display a list of additional operators, and then click the one that you want to use. For more information, refer to Relational Operators. The operators that are available in the list depend on whether you selected Text or Decimal for the Type option.
Value: Specifies the values to use for the conditional statement. To add a value, click , click <enter a value>, enter the value that you want, and then press Enter
. To delete a value, use the secondary mouse button to click it, and then click Delete. Some operators, such as Is blank and Is not blank, do not require a value to be specified. In these situations, the Value field is not available.
Type: Specifies whether the conditional statement is evaluating a text or decimal value.
Conditionally, based on expression: Specifies the conditions under which the action runs. Use this option for situations that require more than one conditional statement. When you select this option, you can create the conditional expression in the input box by creating the conditional statements that you want. You create and edit your conditional expression on the Tree View tab. Click the Text View tab to see a read-only text view of the conditional expression.
Input box controls (Tree View tab)
[Conditional Joiner]: Specifies the conditional joiner for the conditional statements within the group. The default conditional joiner is And.
Click the existing conditional joiner to display a menu that you can use to configure your conditional expression in one of the following ways:
And, Or, NotAnd, NotOr: Click the conditional joiner in the list that you want to use for the conditional statements. For more information about the supported conditional joiners, refer to Conditional Joiners.
Add Condition: Click to add another conditional statement to the current group.
Add Group: Click to add a subgroup of conditional statements to the current group.
Remove Group: Click to delete the subgroup. Available when you open the menu from a subgroup.
Clear All: Click to delete all conditional statements (including subgroups). Available when you open the menu from the top-most group.
: Adds a conditional statement to the group that is associated with that joiner. Visible to the right of each conditional joiner in your expression.
: Deletes the conditional statement. Visible to the right of an existing conditional statement when you point to the statement.
Variable: Specifies the variable that you want to use for the conditional statement. Enter the variable in the input box. Click to see a list of recently used variables or click More Variables to open the Insert Variable dialog.
[Relational Operator]: Specifies the relational operator to use for the conditional statement. Click the existing operator to display a list of additional operators, and then click the one that you want to use. For more information, refer to Relational Operators. The operators that are available in the list depend on whether you selected Text or Decimal for the Type option.
Value: Specifies the values to use for the conditional statement. To add a value, click , click <enter a value>, enter the value that you want, and then press Enter
. To delete a value, use the secondary mouse button to click it, and then click Delete. Some operators, such as Is blank and Is not blank, do not require a value to be specified. In these situations, the Value field is not available.
Type: Specifies whether the conditional statement is evaluating a text or decimal value.
Error Handling and Diagnostics
Ignore errors and continue running actions: Specifies that if the action fails, the remaining actions continue to run. When this option is not selected and the action fails, the resulting behavior depends on several factors, as follows:
The action is within a Group action
If you specified Sequentially for the Execute Actions property on the Group action's Execution tab, no further actions within that Group action are run. No actions outside of this Group action are affected.
If you specified In Parallel for the Execute Actions property on the Group action's Execution tab, the errors are ignored, and the other actions within that Group action are run. No actions outside of this Group action are affected.
The action is not within a Group action
If you specified Sequentially for the Execute Actions property on the event's Execution tab, no further actions within the event are run.
If you specified In Parallel for the Execute Actions property on the event's Execution tab, the errors are ignored, and the other actions within the event are run.
Retry if failed: Specifies that if the action fails, BarTender tries to run it again.
Maximum retries: Specifies the maximum number of times that BarTender tries to run the action again. Available when the Retry if failed option is selected.
Retry interval: Specifies the length of time that BarTender waits after the action fails before it tries to run the action again. Available when the Retry if failed option is selected.