Detecting Whitespace in a V_WString
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi folks!
Hope all is well. Does anyone know REGEX_MATCH to detect whitespace? I'm not trying to cleanse it, just detect it and take it out for further action as part of a workflow.
Thanks!
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, @caltang
Maybe you can upload sample data for input and output ?
REGEX_CountMatches([Txt], '\s')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm actually on my mobile right now, and just wanted something quick - thanks @flying008 will try it. If it fails, I'll upload a sample file tonight OR if it works I'll mark your comment as the solution
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @caltang what do you mean by detect and take it out? Do you mean flagging when whitespace is present? Parsing it into another field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes sir!
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Unfortunately, that just removes everything with a space haha @flying008
Not your fault, it was mine - I have uploaded a sample. 4th Tab is called "D Field " with a whitespace at the end. The consistent factor is, the whitespace is always at the end.
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @caltang , guess you could do it like this with the RegEx tool using Tokenize:
This splits the Field A into two fields, one with the whitespace and one with the rest of the string. If there is no whitespace at the end, Field A2 will be null, which will flag the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @FinnCharlton - you gave me a great idea!
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
