I required last 4 IP addresses Individually


Dear Support Team,

Please Provide IP Information for the following Addresses 
11.26.29.165
111.272.392.645
111.891.622.928
112.33.74.284

I tried like below it is not working properly.

Thanks in advance

Hi @Manju_Reddy_Kanughula

Can you use the following RegEx:

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

image

Hope this helps,
Best Regards.

Hey @Manju_Reddy_Kanughula ,
I believe this exercise is from the Bots DNA .
So for that to take this individual values
You can directly put this inside a datatable and you can put for each row in data table for each row.
1.Read text file
2. Use generate data table activity
3. Use for each row for that Generated data table you will get seperate rows.

This is the configuration inside generate data table

Regards,

5 Likes

I required Individually, not in combined.

Hello @Manju_Reddy_Kanughula
Try this

System.Text.RegularExpressions.Regex.Matches(YourString,"\d+.\d+.\d+.\d+")(0).Tostring  ----> 11.26.29.165
System.Text.RegularExpressions.Regex.Matches(YourString,"\d+.\d+.\d+.\d+")(1).Tostring ----> 111.272.392.645
System.Text.RegularExpressions.Regex.Matches(YourString,"\d+.\d+.\d+.\d+")(2).Tostring ----> 111.891.622.928
System.Text.RegularExpressions.Regex.Matches(YourString,"\d+.\d+.\d+.\d+")(3).Tostring -----> 112.33.74.284 

1 Like

Hi @Manju_Reddy_Kanughula ,

There always will be only 4 IP addresses?

Hi @Manju_Reddy_Kanughula,

Although this thread is solved, I am adding another alternative method here.

Explanation
File.ReadAllLines returns an array of all the lines in the input file
We skip the first index (0) and only get all other index (lines) values

File.ReadAllLines("InputTextFile.txt")(Index)


image


If in case you are interested only in the last value you can use
File.ReadAllLines("InputTextFile.txt").Last
image


Documentation here : File.ReadLines Method (System.IO) | Microsoft Learn

1 Like

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