Separate date and time and for loop each date and time

I have sample get text of date and time as follows:

      18-12-2024 :
      15:30:00

      19-12-2024 :
      09:30:0014:30:0016:30:00

      20-12-2024 :
      10:30:0014:30:0016:30:00

      21-12-2024 :
      10:30:0014:30:0016:30:00

      23-12-2024 :
      10:30:0014:30:0016:30:00

I need to iterate each date and time to check if each time is available on scheduler. How can I achieve this? Because I tried 2 different Find Matching Patterns activity, to get date and time but I realised that logic is not reliable.

What i want is for example:
bot will for loop each date, then another for loop to check time. the problem now is assigning each time to their own date

Any other ways to achieve this?

Hi,

Can you try the following sample?

mc = System.Text.RegularExpressions.Regex.Matches(strText,"(?<DATE>\d+-\d+-\d+)\s*:\s+(?<TIME>[\d:]+)")

mc2 = System.Text.RegularExpressions.Regex.Matches(currentMatch.Groups("TIME").Value,"\d{2}:\d{2}:\d{2}")

Sample
Sample20241217-2.zip (2.8 KB)

Regards,

its working!!

is there a better way if condition met and i want to Break the whole loop. The IF condition is met in the inner loop. How can i break for the outer for loop too?

Hi,

We can achieve it using Break activity ad flag variable as the following, for example.

Regards,

thanks ! same method as what im thinking

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