How do I copy line by line?

I’m planning to make an IPv6 expander (2001::1 → 2001:0000:0000:0000:0000:0000:0000:0001), and I was wondering how do I get UIPath to select and copy a new line each loop. What I want to do is to get all the IPv6 on a notepad, feed it into a website that expands the IP, and then pasting it into excel. However, I am stuck at how I’m suppose to change the selection of IP to a new line. Also, how is UIPath going to know when to stop looping? Do I have to have an input box and key in the number of IPs manually, or is there a way for it to detect the number of IPs?

HI @promaster

are you trying to say this regarding in command prompt of getting ipconfig details

Thanks
Ashwin S

Hi @promaster

Welcome to UiPath community buddy
If the input is in this format stored in a variable of type string
In_text = “(2001::1 → 2001:0000:0000:0000:0000:0000:0000:0001)”
Then kindly follow the below steps that could help you resolve this
–use a assign Activity to store the above value to a variable, as mentioned above
–then again use a assign activity and mention like this where Out_ip_array is a variable of type array of string
Out_ip_array = Split(Split(in_text.Replace(“(”,“”).ToString.Replace(“)”,“”)," → “).ToString,”:")
This will give an array of value like this{“2000”,“0000”,“0000”…}
– Now use a write text File Activity and pass the input as
String.Join(Environment.NewLine,Out_ip_array) and pass the file path of notepad
This will enter the ipv6 value one by one with a Newline in notepad

Thats all buddy you are done
Kindly try this and let know whether this works or not
Cheers @promaster

Hi @Palaniyappan

This is giving System.String

Thanks
Ashwin S

Yes it would actually buddy
Its an array of string
To get a value at a index we need to mention that index like this
Out_ip_array(1).ToString
Not this alone Out_ip_array
Cheers @AshwinS2

Hi @Palaniyappan

buddy the query is not getting splitted can you send the xaml

Thanks
Ashwin S

It is regarding notepad.

For example, I have these IPs in notepad and I want to copy and paste these individually.
2001::1
2001::2
2001::3

Hi @Palaniyappan

I should have been more clear regarding what I’m trying to do.

I have a notepad with different IPv6s, for example: Screenshot - 0c02a51b35ace96285afb7eb844714d4 - Gyazo

I want to paste these IPs into IPv6 Subnet Calculator - subnettingpractice.com and get the expanded version.

After that, I want to paste it into notepad, getting this as a result:
https:// gyazo .com/39c53ae97f53d670e48d2630a41e18c6 (Sorry, please delete the spaces as I can only put 2 links since I’m a new user)

I have a question:
How do I copy each line individually in order to paste it into the website and expand the IP?

@promaster

  1. Use Read Text File activity to read text from notepad file and store it into one string variable and say ‘notepadText’.

  2. Then split this text based Delimiter as New Line and like below.

strIP [ ] = notepadText.Split(Environment.NewLine.TocharArray)

The above expression will give you array of strings.

Based on Index, read one by one.

strIP(0) - First Line
strIP(1) - Second Line
etc…