Remove trailing whitespace
- 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,
I have a trial balance exported from source system in .csv
I have tried the Data Cleansing tool with Remove "Leading & Trailing Whitespace" checked, however it doesn't work.
So I suspect while it appears to be a trailing whitespace to me, Alteryx is reading it as something else. I am having a similar issue with this data source in Tableau.
If I also check "All Whitespace" within the Data Cleansing Tool, the apparent 'trailing whitespace' is removed but so are all the spaces in my account names
Any ideas?
Solved! Go to Solution.
- Labels:
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Regex_replace([field],'[^\x20-\x7E]','')
Cheers,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you, that worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for that. How would I apply the same to 7 columns without 7 RegEx tools?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello, i have been trying to get this to work too, but it's not. My data may be slightly different in that i have a regex earlier on in the flow which is removing text between brackets so from:
AB1234 (XY23RG) Widget
to
AB1234 Widget
I think in doing this using \(.*?\) it's leaving a trailing space as i have two spaces inbetween now. Like the original poster the data cleanse tool is not getting rid of it, and the suggested regex here doesn't appear to work either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thought the behaviour you describes makes me think that this isn’t actually whitespace as in fact some funky character that looks like whitespace.
What I would do is take a sample like and use the text input to right that value out, as you write it out you know you are using the space key, then perform a join, if they don’t match then it’s some strange chars that are causing the issue.
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks, looking at the data a bit more my issue is definitely caused by the removal of the text in brackets. Cells where there is no brackets works fine.
