File Operation
Japanese may be displayed on some pages.
Home > User guide > BOT > How to use the BOT editor > File Operation
Introduction - File Operation
Operations such as file download/upload can be automated.
The downloaded file is saved in a Virtual browser temporarily.
The file downloaded in the Virtual browser can be set as the output value after upload operation or BOT execution by copying it as the BOT data value.
Download a File
Click a Button to Download a File
- Place the cursor on the button.
- Click [Click] in the operation menu.
Download a File Using a Link
- Place the cursor on the link.
- Select [Other functions] in the main menu and click [Download].
Download an Image File
- Place the cursor on the link.
- Select [Other functions] in the main menu and click [Download].
Download a Displayed Page
- Place the cursor on the address bar.
- Click [Download the URL].
Review the List of Downloaded Files
• Click [View] in the “There is a new download file.” message.
• Or, click [Download(s)] (top right of the BOT Editor).
Preview a File
- Open the Downloads screen and select [Preview].
Copy a File to a Data Value
The downloaded file can be copied as a BOT data value to select as an upload file or output as a BOT’s execution result.
- Click [Copy x file(s)] on the Downloads screen.
- Select [New data] in "Destination data".
- Enter a value in the [Data name] text box.
Selection Conditions for Files to Be Copied
BOT searches the Virtual browser for the file to be copied. At that time, the following conditions take precedence.
- Selected in order from the newest downloaded file.
- If you specify a file name, a file with the same name will be selected.
Use wildcard
The following wildcards can be used to define the file name.(*: Contains any zero or more characters , ?:Contains any one character)
Sample | Applicable file name |
---|---|
*.jpg | All files with a .jpg extension |
* | All files |
?.jpg | Files with a .jpg extension and any 1 character |
??.jpg | Files with a .jpg extension and any 2 character |
wh* | who, why, what, when, which... |
wh? | Who or why |
Use regular expression
[. *] button can be enabled to use regular expressions to specify file names.
Sample | Applicable file name |
---|---|
\d{4}-\d{2}-\d{2}\.csv | Files with .csv extension and YYYYY-MM-DD file name format |
\d+\.png | Files with .png extension and a file name of at least one arbitrary number |
Copy Multiple Files as One Data
When coping the downloaded as a BOT data value, you can copy multiple files as one data of BOT (In technical terms, it can be treated as array data).
In the "The file to copy" item, you can add files to be copied with [+] , and reduce the number of files to be copied with [-].
When copying to existing data, select the relevant data name in "Destination data".
You can also narrow the number to copy by selecting check boxes. You can set whether the file is required or not.
Rename and copy the file
When copying a downloaded file as a BOT data value, you can click the "Copy as" button, rename the file, and copy it.
References to data in the BOT
The value stored as data in BOT can be referenced by using $ {data name}.
You can browse the data and insert it into the Script from the Data reference button.
Use regular expression capture
A regular expression capture can be used to reference a specific string from the original filename and insert it into the filename.
Upload a File
You can upload a file that is set to the data value.
[When uploading the downloaded, you have to copy the file as a data value.] >> Click here for details
- Place the cursor on the button.
- Click [Click] in the operation menu.
- Select the set data value from the drop down menu.
- Click [Choose file].
Use Cloud BOT Agent version 3.0.0 or later.