tmap and usage of context variable in ereplace

Two Stars

tmap and usage of context variable in ereplace

Hello

 

I am trying to do simple task using tfileinput, tmap and tfileoutput.

 

I read a file and wanted to replace specific string with another string. The another string comes from context variable and it doesn't allow me.

 

following works 

StringHandling.EREPLACE(row1.filescript,"source","myname")

but when I try doing following way it 

context.var1 = "myname"

StringHandling.EREPLACE(row1.filescript,"source",context.var1) it doesn't allow me. If I click Test is shows me following

 

The static field TalendJavaSourceViewer8.ContextProperties.var1 should be accessed in static way

 

Any help how I can use context variable value to replace in my text file.

 

 

 

 

 

Moderator

Re: tmap and usage of context variable in ereplace

Hello,

Where is the value your are retrieving and assigning it to your context variable? Could you please show us your tMap editor screenshot?

Please check your "Code" tab in your job to see if here will be your compile error highlighted in red line?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARTNER 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

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now