replace all special characters with its html entity in single shot.

Highlighted
One Star

replace all special characters with its html entity in single shot.

Hi,
I have an xml file and i have created 100 coumns corresponding to each attributes in xml.
Now, i want to search all special characters and replace it with its corresponding html entity in one shot.

But, i don't want to search each character in one column repeatedly..


something like this:--
search pattern is : "[\\>\\-\\.\\^]"
replace pattern is : "\\>\\–\\·\\ˆ" so, i want if column contains ">", it replaces it with only ">" not with whole replace pattern..


please give reply soon

Re: replace all special characters with its html entity in single shot.

One Star

Re: replace all special characters with its html entity in single shot.

Is there a specific need to use a single regex pattern for the replacement?
I did this same procedure by simply using the tReplace component. Just configure the input column, type in the needed html special character and the entity for the replacement. Like Column 1 - < - < etc.

Maybe i missed the point here?
One Star

Re: replace all special characters with its html entity in single shot.

Oh, of course in XML you need to search the whole html tags (<p>) and replace with full entities (<p>). Sorry. But still tReplace might be a viable option?

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Enabling Data Governance

Learn how to enable Data Governance

Watch Now

The Definitive Guide to Government Data Quality

Take a peek at the definitive guide to Government Data Quality

Read