How to retrieve specific data from a txt file?


Here I’m attached a image please refer this image and let me help to build this use case

1 Like
  1. Read the text file into a string variable.
  2. Convert the string variable into an array, each line as an array item.
  3. Use For Each activity to loop trough items of the array and use regex to pick out the lines containing IP addresses.
  4. Assign each IP into a variable or add into a list, depending on your use case
1 Like

as I’m new to this field, I’m a little confused. Would you like to give me one demo? Here I’m attaching the text file
4261.zip (241 Bytes)

Hi,

Please try with regex pattern.

\b\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\b

Store result in Variable and using split store it to variables

4261.zip (241 Bytes)
Here is the text file would like to design the bot in uipath and if possible please send me the xaml file.

ForumTestSequence.xaml (7.1 KB)

check this sequence. instead assigning to variable, it would suggest use list.

Hi @Kumar_Sahu_Sameer ,

We do see that the data is in the form of text and there are 4 values to be extracted , but could you also confirm whether it would be always 4 values or will it be varying ?

If it varies, instead of assigning to 4 variables, we could use a Dictionary and place the values according to their positions.

Let us know this confirmation from your side so that we can help you better.

1 Like

yeah it’s varing

@Kumar_Sahu_Sameer ,

Do let us know if the Suggestions provide above satisfy your requirements, as it may seem that an Array/List of the extracted data would be also sufficient for your case.

Let us know if you still need help and describe the requirement to the format of output required.

as I’m new to this field I’m now able to execute that in my uipath path. So I would like to request to you please design the bot and share it with me. Here I’m attaching the text file.
4261.zip (241 Bytes)

@Kumar_Sahu_Sameer ,

Have you checked the Sequence provided by @shaik_Azam ?

Let us know if it satisfies your requirement.

1 Like

Okay, let me check. Thanks for the instant response.

1 Like

Yeah It’s working fine. Thanks everyone for helping me. You guys are awesome.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.