Hello,
I'm working on a project that requires me to use RegEx to retrieve data.
Situation:
The client has a Free Text column, and I need to get the data from there using RegEx based on specified terms.
The position of specific words in the column is not fixed.
I've included an example of the data.
Input | Output1 | output2 |
The Id contains ProtocolId 1001 and SiteId 2001 | 1001 | 2001 |
The Id contains SiteId 2002 and ProtocolId 1001 | 1001 | 2002 |
The Id contains ProtocolId 1001 and SiteId 2003 | 1001 | 2003 |
The Id contains ProtocolId 1001 and SiteId 2004 | 1001 | 2004 |
The Id contains ProtocolId 1001 and SiteId 2005 | 1001 | 2005 |
Please check and assist me to find the solution.
Please also include a sample workflow if possible.
If you have to use Regex, it could be more complicated but if you only have letters and want to parse out the numbers just use a data cleanse tool and remove letters, then use a text to columns to split on the delimiter that results from the data cleanse.
Hello @binuacs and @DataNath ,
the solution which is provided from your end its not working for me.
Kindly check with the new example which I am uploading here.
Input | Output1 | Output2 |
This data is belong to 6. ProtocolId-1000 7. SiteId - 2000 | 1000 | 2000 |
This data is belong to 6. ProtocolId-1001 7. SiteId - 2001 | 1001 | 2001 |
This data is belong to 6. ProtocolId-1002 7. SiteId - 2002 | 1002 | 2002 |
This data is belong to 6. ProtocolId- 7. SiteId - 2003 | null | 2003 |
This data is belong to 6. ProtocolId-1004 7. SiteId - 2004 | 1004 | 2004 |
This data is belong to 6. ProtocolId-1005 7. SiteId - | 1005 | null |
If possible provide the solution for this and attach the sample workflow.
@shashank_shukla how do you get on with:
\d+\.\sProtocolId\s?-(\d+)?\s\d+\.\sSiteId\s?-\s?(\d+)?
Not on my laptop to test with the flow, sorry, just quickly trying used RegEx101.