Regex collection to datatable

str

"

1
5551
85%

2
258
100%

3
896
59%

4
213
10%

"

Op
ranking,route,percentage
1,555,85
2,258,100

and so on

Help me out

Hi @Sachin_P

Please try the below workflow:

Input = "1
5551
85%

2
258
100%

3
896
59%

4
213
10%"
matches activity regex : "\d+[\s\S]*?\d+\%"

Assign activity:

Ranking= System.Text.RegularExpressions.Regex.Match(currentItem.ToString,"\d+(?=\s+\d+\s+\d+\%)").Value.Trim()

Route= System.Text.RegularExpressions.Regex.Match(currentItem.ToString,"(?<=\d+\s+)\d+(?=\s+\d+\%)").Value.Trim()

Percentage= System.Text.RegularExpressions.Regex.Match(currentItem.ToString,"(?<=\d+\s+\d+\s+)\d+(?=\%)").Value.Trim()

Workflow:

xaml:
Sequence26.xaml (13.6 KB)

Build Data Table:
image

Output:

Regards

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