Ask Your Question

How to replace special character in streamsets

asked 2019-02-01 03:36:32 -0500

siddhu gravatar image

I am trying to load between teradata and Greenplum. I need a logic to replace special characters with blank in streamsets.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-01 06:42:10 -0500

Maithri gravatar image

updated 2019-02-07 05:57:11 -0500

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:

image description will result with:

image description

 ${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:

image description

edit flag offensive delete link more



Thank you for the help.

siddhu gravatar imagesiddhu ( 2019-02-07 10:38:01 -0500 )edit
Login/Signup to Answer

Question Tools



Asked: 2019-02-01 03:36:32 -0500

Seen: 57 times

Last updated: Feb 07