Inspire EMEA 2022 On-Demand is live! Watch now, and be sure to save the date for Inspire 2023 in Las Vegas next May.
We'll be completing standard maintenance for our Single Sign-On system on November 30th 6pm Pacific Time for approximately one hour. During this time My Alteryx and sign-in functionality to all My Alteryx programs (Licensing Portal, Community, Beta Program, Case Portal, and others) may be inaccessible. Thank you for your patience.

Alteryx Designer Discussions

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

Elegantly remove all ASCII characters outside the range 32 -126

jhollingsworth
7 - Meteor
Hello Artisans,

I'm working on a module that includes a geocoder tool. I'm running into an issue in which the data the users are submitting to the module are copied from a web page and sometimes include weird characters (e.g. ASCII 160). This causes the geocoder problems. And by problems, I mean that the geocoder can only find the zip code when without the odd characters, it can find the address.

What I'm looking for is the most elegant way to remove any characters from a text value that fall outside of the ASCII range of 32 -126. Any characters inside that range *shouldn't* cause the geocoder problems.

Extra cool points to anyone from Alteryx that will fix incorporate this fix into the Address tool. :-)

Cheers,

John Hollingsworth
13 REPLIES 13
BrettMRP
5 - Atom

@Jordken Change the expression to read as follows:

 

regex_replace([_CurrentField_],"[^\xA,\xD,\x20-\x7e]+",'')

 

[_CurrentField_] being whatever your field name is if you are using the formula tool and not the multi field tool

MarqueeCrew
20 - Arcturus
20 - Arcturus
[ -~]

That's the range as elegantly as possible.

Cheers,
Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
SideOfRanch
7 - Meteor

Is there a way to do this but return if the field had one of the untranslatable characters? I'm trying to identify them the fields and flag them with a 1 if they have a bad character.

MarqueeCrew
20 - Arcturus
20 - Arcturus

MIN(Regex_Countmatches([Garbage Data],"^[ -~]"),1)

 

 

That might help.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels