Ask Your Question

Revision history [back]

refer:

https://ask.streamsets.com/question/323/how-to-rename-all-fields-using-regular-expression/ https://ask.streamsets.com/question/1060/how-to-remove-n-from-the-result-dataset/

refer:You can use Expression Evaluator and replace all unwanted special characters with blank space:

https://ask.streamsets.com/question/323/how-to-rename-all-fields-using-regular-expression/ https://ask.streamsets.com/question/1060/how-to-remove-n-from-the-result-dataset/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

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, /*#) 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

You can use Expression Evaluator and replace all unwanted special characters with blank space:

for 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