Split String New Help

Good afternoon,
I need help. I am using screen scraping to get the information off of bluezone screen. It automatically saves it as a variable. The information is in a structured format. I want to split the string.
I am still having an issue with getting the information from the blue zone screen. To get the data below, if I remember correctly, the point of reference would be the spaces, which I would indicate by “ “. When I do that it is not giving me the data I need. Is there another way or could you tell me what I am doing wrong? To review: I need the information below the heading. The data will always vary, but it will be in the same format. I would only need the information under: CARDHOLDER NMBR, AMOUNT, and TRDT. I will need to put that information in an excel spreadsheet. I have provided a screenshot below of the bluezone screen. Thanks for all the help!

@mlmyers

I guess this is an emulator. How are you extracting data from this screen and what kind of data is available in your string variable.

Can you please share these details and possibly part of your designed workflow too. Helpful to understand the problem.

I am using Native screen scraping method. All the information is showing in the output of the message box. I have provided the workflow and message box. Thanks

SessionDisplay = SessionDisplay.Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries

That is not returning anything

@mlmyers

I’d suggest that try to shorten the string and get the data only between RC ( just before 001) and PF( at the bottom left side). This way we’ll have only exact data to deal with.

Post that try to add comma (,) after every FILE keyword if it’s constant at the end of every row for all data in your screen. The reason behind addition of comma is that if you directly split with space , you’ll be not able to identify particular indexes for all rows. Using this, you’ll have to deal with one row at a each time when you split with space delimiter.

After this, split your entire string using .Split(",") function which will return you array of string(in short one line of record in one index of string array). Now, apply split function with space delimiter(" ") and you’ve all of your values in another string array.

By knowing the values positions you can pass indexes and get the values for each row.

I know it’s bit long string operations. In my opinion, I think we should filter the required data from the string first and then apply our logic on that.

Let me know if this works or not. I’ll be happy to help you.

1 Like

@singhonkar Could you provide an example please? I am unable to shorten the string; it says index was outside the bounds of the array and I am only using (0) and (1).

@mlmyers

Sorry for late reply. Couldn’t get enough time to look after your issue.

Can you please share your extracted data in a text file so that I can work exactly on the data. You can change values of cardholders as that’s a private information.

You can send me in mailbox. I’ll get back to you once I get any update.

Use VBLF as delimiter for spliting newline character.

array_variable = SessionDisplay.Split({VBLF},StringSplitOptions.RemoveEmptyEntries)

@mlmyers

I suggest you to try Generate Datatable activity.

Pass the Column separator as " " and row separator as VBLF. It will return your values in datatable.

I had to add a number to the end of the line to call a row. When I added (5), it shows the first line of the needed information only. I saved it to a datatable and the append range. It displays that line in the excel sheet. I feel as if we are close…but far.

@mlmyers

I went through the data shared by you and able to solve your problem. I kept that data into text file and extracting it as a string. So that you can directly pass the output of your getVisibleText activity. Please find the attached xaml file.
Split String.xaml (16.8 KB)

There were tabs and single space available in the rows. Handled it as well. Try run this file on your fetched data.

Let me know incase of any further queries.

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