Breaking multiple text from screen scrap into variables

I can screen scrap the below box on a website and it will output both text elements if I write the screen scrap variable using WriteLine as shown.
image
image

I need to be able to use each text line as a variable later on in the sequence.
So I could make (SEP001…) into variable1 and (IPC-QX…) Into variable2

I’ve searched and can’t really wrap my head around how this would be done.

Really i’m needing to have the program tell where the SEP00… text is located in the list if it’s on top or at the bottom or in the middle of the other text elements. This way the program can choose it and continue on. The only way I found to get the text from the box was with a screen scrap.

Any help is much appreciated

~James.

Hi @Nerd,

You can do one thing you can split the text according to new line by using this code
string[ ] lines = theText.Split(new[ ] { Environment.NewLine },StringSplitOptions.None);
In this “lines” will be array of string now you can assign lines[0] in var1 and lines[1] in var2 and use that in further sequence.

Thanks!1
Anmol

Hey @anmolk171 Is there any chance you could give me an example of this? This sounds like what I’m needing to do but can’t wrap my head around it.

sure I will provide you the xaml. give me some time.

You are the best! Thank you!

Hi @Nerd,

Sample xaml is attached. Please mark it as a solution if it worked.

Split_New_Line.zip (13.2 KB)

Best!!
Anmol

Hey @anmolk171

That seems to be what I need to do but I’m getting the following when I try to assign the variable that was made when I did the screen scrape.

I’m doing Arr=SelectSelecteddevicea.Split(Environment.NewLine.TocharArray)

SelectSelecteddevicea was the variable the screen scrape generated.

Hi @Nerd,

Can you please share the workflow if not then make sure SelectSelecteddevicea variable must be string.

Best!
Anmol

@anmolk171 You had it right! I missed making it a string instead of just a string. That worked. Thank you for the help!

1 Like

Anytime @Nerd

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