How to replace special character in streamsets
I am trying to load between teradata and Greenplum. I need a logic to replace special characters with blank in streamsets.
You can use Expression Evaluator and replace all unwanted special characters with blank space:
For example: I want to replace all other characters accept the required charaters(ex: letters,numbers) with blank space: use the expression in expression evaluator as:
will result with:
${str:replaceAll(record:value('/fieldname'),str:unescapeJava('[all the unwanted characters]')," ")}
1)Either you can include all the characters you need :
str:unescapeJava('[^A-Za-z0-9]') this will replace all the characters accept letters(alphabets) and numbers.
2)Or you can mention what are the characters you need to exclude :
str:unescapeJava('[/*#]') this will replace all the included characters with a blank space
similarly you can include more characters:
Asked: 2019-02-01 03:36:32 -0600
Seen: 44 times
Last updated: Feb 07