Script for RoboTask – the division of text into lines

Our current training video associated with this action, which we do constantly, or would like to make it. After all, you can split text by rows is very convenient, especially if you have a document with a large amount. How to use the program RoboTask to realize the separation of any text portions of the rows will be discussed in this article.

How to create an action using this program, we have described in previous articles, so let’s start with the actual action.

To call the operation as you like, most importantly, so you can quickly find it, so we will call action “File to Divide parts”.

Immediately warn readers that I didn’t use plain text, and formatted text .CSV. This is a popular format for building data tables, for example, for the online shop.

We will see how to work with variables, since it is not always convenient in operation RoboTask to specify the full path to the files.

So, the first step we have is to minimize application (if necessary, work action in the system tray).

Next is item – TXT Number of Lines – here we specify the file from which to take the text, and also which variable to assign the resulting value. In the text field write any variable, and the value for it will put a bit later (I have this {file]).

Now referred to in paragraph Simple Loop start of text and end, i.e. which row to start the cycle and what line to finish its processing. To start the action it will be 1 and our first variable with the numeric value of the string. Since I have a large document,and the numbers are not small. Its variable will be the value {first]. And the variable in which to store the resulting value is {NEXT].

Next paged data from text (during cycle) – in TXT From External File write the same variable that was used earlier – {file]. In the field the origin (from 1) write the value from the previous item operation {NEXT]. The extracted string will be written to a different value {LINE].

Thus, we got the original line, and the cycle indicated values which will satisfy the condition.

To copy to clipboard the result, we need to specify the variable in Put Text.

And to write this data, we will need to enter the variable in the box Write Text File.

In the text box write the variable from the first file where to insert text content – {file01]. In the recording box, write the line.

So, repeat the steps with the cycle, but with the correction data. for example, in the second cycle is the beginning of the sampling line, as shown in the figure. Well, of course, will vary the output file where to store the result.

And most importantly – stamped values for the variables in the Local variables.

This will facilitate further work in the processing of other text – you can change at any time the values of the strings and output files.