Extracting data after a Date

Data string

“06/12/20 , HELLO HOME TEST
04/22/20 ,MY TEST DATA
04/22/20 ,UIPATH COM
04/22/20 ,COMPANY
04/16/20 ,HELLO
04/16/20 ,WORLD
04/16/20 ,MY DATA TEST 2”

expected output : " HELLO HOME TEST , MY TEST DATA, UIPATH COM and so on … all the data after dates

you may have two solutions:
1- sort your column in excel first, and then get the text from the column easily.
2- if you have too many excel files and can’t sort one by one then create a uipath sequence that gets excel file and sorts them then get the text attached to the date column.
Good luck

Where is the data string coming from?

Cybertron. sorry I had to

If it’s stored in a single string, then a simple Regex.Replace() could work

System.Text.RegularExpressions.Regex.Replace(str, "[0-9]{2}\/[0-9]{2}\/[0-9]{2}", "").Trim

Then, I would probably split by the comma and rejoin it together, or keep it as an array.
So, the code in its entirety, which can be used in an Assign activity:

String.Join(", ", System.Text.RegularExpressions.Regex.Replace(str, "[0-9]{2}\/[0-9]{2}\/[0-9]{2}", "").Trim.Split({","},StringSplitOptions.RemoveEmptyEntries).Select(Function(x) x.Trim).ToArray)

Disclaimer: I didn’t not test the above sample code, so let me know if there were any problems with it.


1 Like

Sequence.xaml (5.6 KB)
Check theDemo,
if it works, please mark as resolved.



1 Like

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