Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

remove special characters from xml text node using nifi

New Contributor

Hi, i want to remove special characters like \,",' from a text node in the xml. May i know how to do this with replacetext processor.

xml path is something like this and i need to strip special character from the comment text.





<Comment>| 8/2/10 project. code needs to be in TX. SM |&#xA;

"8/2/10" \ Kaplan study materials ordered . SM |</Comment>






Super Guru

@Lokesh Garlapati

Configure ReplaceText processor as shown below


In search value we are looking for [\"|\\|'] any special characters in ",',\ and replacing with empty string.

Java Regex explanation:

[\"|\\|'] -> matches any character in ",',\ and | is act as or operator.

**Note: you need to change the Maximum Buffer size as per your flowfile size.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.