This sample scenario executes following process.
Extract the file name from the full path of the specified file.
Combine the full path of the specified folder with the extracted file name and date, and then generate the full path of the moved file.
Move the file to the generated full path.
In this sample scenario, the following WinActor(OR-5200) modules are used.
The operation of this sample scenario was confirmed in the following environment.
Create a scenario to be executed after waiting,
Extract the downloaded ZIP file. Load this sample scenario contained in the expanded folder with WinActor(OR-5200). For the expanded files, refer to File Structure.
Update the values required to execute this sample scenario in the variable list. Before executing this sample scenario, set the following two variables.
Variable display screen
Start executing this sample scenario. This sample scenario will end when the file is moved to the specified folder.
When the execution of this sample scenario is completed, SourceFileName has been moved to DestinationFoledeName. In the case of Step2 example; "C: \ winactor \ abc.txt" => "C: \ winactor \ temp \ yyyymmdd_abc.txt". "yyyymmdd" is the date of execution.
In this sample scenario, an error message will be displayed if a file name or a folder name is specified incorrectly.
See the error message list for more information.
This section describes the implementation technique used in this sample scenario.
In this sample scenario, just file name is extracted from the full path.
The extraction method in this sample scenario will be explained using the following file path as an example.
In the case of the example of the above file path, the file path is specified by combining some folder names and a file name with "\".
It is consisted of the following four elements, and the file name is always placed at the end of the file path.
The file name in the file path is a rule that the file name is always placed at the end of the file path.
Using this rule, the file name is extracted by "Split_SplitString" of the String Operation operation library in this sample scenario.
In the "Split_SplitString" library, it is a library that divides the "Split_source_string" by the "Delimiter_character"
and specifies the number of information to be acquired from the division result by the "index".
Furthermore, the number of divided elements will be acquired as the "divided size"
By specifying "File path" as "Split_source_string", "\" as "Delimiter_character", and "What number is the last element" as "index" in this library,
just the file name is available to acquire.
However, in the current WinActor(OR-5200) library, it has no library to acquire the value "what number is the last element"
Therefore, so execute the "Split_SplitString" library once in the same way, and set "file path" as the "Split_source_string"
In the above example, it is acquired a value of "4" as the "Segmentation_size"
After that, it is specifed "what number is the last element" and then will be executed "Split_SplitString"
At this time, "what number is the last element" is specified by the index of the programming array, thus it is one smaller than the actual size.
Therefore, it sets the value obtained by subtracting 1 from the division size. In the above example, it sets "3".
In this sample scenario, multiple values are combined by "Set_Variable" in node.
Example of variable setting