How to add prefix and suffix?

One Star

How to add prefix and suffix?

Suppose I have data as follows,
Emp_name|Emp_Id|Emp_dept
Leonardo DiCaprio|1000|Finance
Cristian Bale|1004|Security
Jennifer Lawrence|1002|HR
Morgan Freeman|1006|Admin
Now say I want to add, prefix 'Dr. ' to every entry under column name Emp_name. For example, data in output should be something as follows,
Dr. Leonardo DiCaprio|1000|Finance
Dr. Cristian Bale|1004|Security
Dr. Jennifer Lawrence|1002|HR
Dr. Morgan Freeman|1006|Admin
Or maybe I want to add, suffix 'ABC' to every entry under column name Emp_Id. For example, data in output should be something as follows,
Leonardo DiCaprio|1000ABC|Finance
Cristian Bale|1004ABC|Security
Jennifer Lawrence|1002ABC|HR
Morgan Freeman|1006ABC|Admin
Moderator

Re: How to add prefix and suffix?

Hi,
tMap component can meet your needs.
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.
Highlighted
One Star

Re: How to add prefix and suffix?

Hi, Xdshi.. thanks for your help... it works. What I wanted to know is that you have marked the data type section to show that this logic works on string only... right? Or you want to show that data types on both sides should be matching.
Moderator

Re: How to add prefix and suffix?

Hi,
The "String" type can add string(prefix and suffixSmiley Frustratedtring s=string1+string2) directly with "+". This logic works on string only.
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 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog