tMap expression to convert from Upper case to lower

Nine Stars

tMap expression to convert from Upper case to lower

Hello All

I have data as below following example

MANISH

But i need in the result

Manish

I use the function StringHandling.DOWNCASE(row1.Name) that gave me "manish" as an answer. But i need first letter as caps, can some help me in this?

 

Thanks In Advance 

Manish


Accepted Solutions
Employee

Re: tMap expression to convert from Upper case to lower

@manishchokkaram 

 

Please try below method

image.png

 

image.png

 

The code is as below.

 

row1.data.substring(0,1)

StringHandling.DOWNCASE(row1.data.substring(1,row1.data.length())) 

Please note that you will have to add additional null check conditions for this flow. I am leaving it to you as you are quite familiar with null handling :-)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

View solution in original post

Nine Stars

Re: tMap expression to convert from Upper case to lower

Thanks @nikhilthampi

 

That code worked , but i have requirement in some case we will 2 words or more than 2 words in the string, So I need to populate first letter of every word as capital, For that i written on java routine it worked, But am still thinking can we write an expression in tMap.

Please look at the screen shot attached

For to generate first tab result in yellow highlighted i used the Code from which you sent, to generate second tab which is yellow highlighted  i used java routine.

Can you please let me know if we can handle multiple words with a tMap expression to populate first letter as capital and rest as small ?

 

 

Capitalletter.PNG

 

 

Thanks and Regards

Manish

View solution in original post


All Replies
Employee

Re: tMap expression to convert from Upper case to lower

@manishchokkaram 

 

Please try below method

image.png

 

image.png

 

The code is as below.

 

row1.data.substring(0,1)

StringHandling.DOWNCASE(row1.data.substring(1,row1.data.length())) 

Please note that you will have to add additional null check conditions for this flow. I am leaving it to you as you are quite familiar with null handling :-)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

View solution in original post

Nine Stars

Re: tMap expression to convert from Upper case to lower

Thanks @nikhilthampi

 

That code worked , but i have requirement in some case we will 2 words or more than 2 words in the string, So I need to populate first letter of every word as capital, For that i written on java routine it worked, But am still thinking can we write an expression in tMap.

Please look at the screen shot attached

For to generate first tab result in yellow highlighted i used the Code from which you sent, to generate second tab which is yellow highlighted  i used java routine.

Can you please let me know if we can handle multiple words with a tMap expression to populate first letter as capital and rest as small ?

 

 

Capitalletter.PNG

 

 

Thanks and Regards

Manish

View solution in original post

Employee

Re: tMap expression to convert from Upper case to lower

@manishchokkaram 

 

In this case, a routine is the neat method as you can encapsulate the complex parts within the routine and call just as a function inside tMap.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

 

 

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 2

Part 2 of a series on Context Variables

Blog

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