How to add prefix and suffix?

Highlighted
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.
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.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads