I am using Hive and trying to clean up data that may have multiple unwanted data. Would like to know if I can use a single regexp_replace or translate function for multiple conditions.
For Eg. If the string is 2000 Helen St - DO NOT USE
I need to replace/trim - DO NOT USE
and also change St
to Street
.
The output should be 2000 Helen Street
.
Similarly
3000 Cross St
should be3000 Cross Street
,4000 Mascot Dr
should be4000 Mascot Drive
- etc..
There are about 10 or more such clean up conditions, and the input string could either meet 0 or multiple conditions criteria. Can these conditions be set up in a single regexp_replace
?