How to convert string text into table format

hi ,

in one of my usecase using uipath I got get like below using get text activity.

Can any one please help me to get output as below.

my string :Hello1223:09New23:10Messages23:11

String contains like infoTimeinfoTimeinfoTime
I want store into data into table like below :

Hello12 23:09
New 23:10
Messages 23:11

Is there any regax pattern to split time from string.
Or there any other method for same in uipath.

@prasanna.Ui

Hi,

I don’t think that there will activity which you can use, but i see that there is pattern you can use to parse text. There is one BUT, time have to have HH:mm format ofcourse 24h not 12h.

If format is HH:mm you can do something like this:
Create new string from string you already have by adding:

  1. Environment.NewLine or vbCrLf always 2 chars after double dot “:”
  2. " " (space) always 2 chars before double dot “:”

You should get something like:
NewString = Hello12 23:09"+vbCrLf+“New 23:10”+vbCrLf+“Messages 23:11”+vbCrLf+"

That prepared string you can put to whatever you want by spliting by NewLine.

Probably it is not what you were looking for, but worth to try :wink:

Of course you can create simple method as a custom activity :smiley:

Hello @prasanna.Ui,

I’ll suggest you to use Matches activity
and use this pattern —> \w*:\d*

I’m attaching sample workflow here for your understanding - regex.xaml (5.9 KB)

Awesome.Thanks a ton!

one more question,the pattern is not working for big paragraphs?what is the regex for big paragraphs
pls find the below input
what is the condition to get only 10 digits for mobile number . suppose if we are working with input dialog asking user to enter your mobile number then fro user it should accept only 10 digit mobile number if he send 9 or 11 then it should not proceed . what is the condition please tell me anyone02:56
Hello1223:09New23:10Messages23:11

@prasanna.Ui

Of course it will work. see, (As shown in below shot)


but if your desire text format changes, then you have to make changes there in your regex pattern accordingly.

for this, take flow decision actitvity aftre input dialog, set condition —> No.ToString.Length = 10 (Where No is output variable of input dialog)
So, it’ll check for length. And connect false side of the flow decision to input dialog, so it’ll keep asking for a number until you enter 10 digit number.
:slight_smile:

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