Scrape a text field from Command Prompt

Hi ,

I would like to extract only a specified text field from the output of a command in Command Prompt .
Eg: In the below image,I would like to extract on the field “Subnet Mask” and its value . How can I only scrape that field and value .

image

1 Like

Hi @itsahmedfiroz
– We use screen scrapping option uipath design menu in our studio with which we can scrape the text in cmd window
–Then we can use string manipulation to get the value of subnetMask like this

  1. use screen scrapping and the get the output as a variable of type string named out_text
  2. use a assign activity like this
    out_string_array = out_text.Split(Environment.Newline.ToArray)
  3. use a for each row loop and pass the above variable as input and change the type argument in for each row loop as string
  4. inside this use a if condition like this
    item.Contains(“Subnet Mask”)
    and if this condition gets passed it will go to THEN part of if condition where we can use a assign activity to get the value of subnet mask like thi
    out_value = Split(item,": ")(1).ToString

Hope this would help you buddy
Cheers @itsahmedfiroz

5 Likes

HI @itsahmedfiroz - I think you will not be able to scrap that particular value. Rather try using Get Text activity and from that Output perform String Manipulations to get the output.

Thanks,
AK

Hi @itsahmedfiroz
Use send hot key event as Ctrl+A and Ctrl+C and use copy selected text and store it in string variable

Thanks
Ashwin.S

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