I want to split the time , names , messages that is iterated from for each loop from the index row(0)

i want the time , name and messages invidually,

Where is the data ? you can use use Data Scraping and after that use the Matches activity in For Each

HI @pravin98 - You can read the entire data into a string and split the string by newline . From there you can fetch each value.

Thanks,
AK

Hi @pravin98

Just split row(0) with new line, so you can get the following details
array(0) - Time
array(1) - Name
array(3) - Message

1 Like

this is the output of the data scraping from that i have iterated is the above output screen shot.

CVAL.Split({VBLF},StringSplitOptions.None)(0).Trim—Time
CVAL.Split({VBLF},StringSplitOptions.None(1).Trim----Name
CVAL.Split({VBLF},StringSplitOptions.None)(3).Trim-----Message

If you are not getting with VBLF then try with,
1)VBCRLF OR
2)VBCR

Hi @pravin98
Follow the below steps to get time, name, and messages individually:-

  1. TimeAndName = inputvar.split({“:”},StringSplitOptions.None)(0).trim , now on 0 index time and name is available.
    1.1 Time = TimeAndName.Split({Environment.NewLine},StringSplitOptions.None)(0).Trim.ToString
    1.2 Name = TimeAndName.Split({Environment.NewLine},StringSplitOptions.None)(1).Trim.ToString
  2. Message = inputvar.split({“:”},StringSplitOptions.None)(1).Trim.ToString

Cheers!

Hi @ImPratham45

I am scraping data from a website, and using your suggest approach. It works fine if I scrap couple (multiple) sites, but as soon as I scrap + 300 or more sites I get the error “Index outside bounds of array” in the assign activity.

Do you have any idea what could cause that issue? Maybe the bot is not able to handle that much input of information?

My assign looks like following:
VarPrepData.Split({VBLF},StringSplitOptions.None)(0).Trim ->> goes trough…

Error on the second assign:
VarPrepData.Split({VBLF},StringSplitOptions.None)(1).Trim ->> assign to a variable called ->> split 2

Would appreciate any help. Thanks.

Regards Edin.

This error occurs when u are try to access data from an array which is not possible say if Array has only 3 items and you try to fetch 4th one /

1 Like

I see… It helps! Some of the scraped data has even more arrays…

Thank you very much @ImPratham45!

1 Like

Most Welcome :smiley: