Support Questions

Find answers, ask questions, and share your expertise
Announcements
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.

<Producer>

<Individual>

<BusinessProcesses>

<BusinessProcess>

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

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

</BusinessProcess>

</BusinessProcesses>

</Individual>

</Producer>

1 REPLY 1

Super Guru

@Lokesh Garlapati

Configure ReplaceText processor as shown below

108905-screen-shot-2019-05-23-at-111429-pm.png

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.