Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Fetching The Data Using RegEx.

shashank_shukla
8 - Asteroid

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.

 

InputOutput1output2
The Id contains ProtocolId 1001 and SiteId 200110012001
The Id contains SiteId 2002 and ProtocolId 100110012002
The Id contains ProtocolId 1001 and SiteId 200310012003
The Id contains ProtocolId 1001 and SiteId 200410012004
The Id contains ProtocolId 1001 and SiteId 200510012005

 

Please check and assist me to find the solution.

Please also include a sample workflow if possible.

12 REPLIES 12
kuoshihyang
7 - Meteor

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. 

 

 

kuoshihyang_0-1652982655941.png

 

shashank_shukla
8 - Asteroid

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.

 

InputOutput1Output2
This data is belong to 6. ProtocolId-1000 7. SiteId - 200010002000
This data is belong to 6. ProtocolId-1001 7. SiteId - 200110012001
This data is belong to 6. ProtocolId-1002 7. SiteId - 200210022002
This data is belong to 6. ProtocolId- 7. SiteId - 2003null2003
This data is belong to 6. ProtocolId-1004 7. SiteId - 200410042004
This data is belong to 6. ProtocolId-1005 7. SiteId - 1005null

 

If possible provide the solution for this and attach the sample workflow.

DataNath
17 - Castor

@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.

Labels