how to remove white space for integer column values in talend

Eight Stars RAJ
Eight Stars

how to remove white space for integer column values in talend

Hi Talend Folks,

I want to remove white space for integer column values in database using talend.

whether it is possible or not ?

 

input

s.no 

   0000 

 

output 

s.no

0000

Thanks
RAJ

Accepted Solutions
Community Manager

Re: how to remove white space for integer column values in talend

Yes, this is pretty straight forward. Just place the following code in a tMap (or similar)....

 

row.columnWithSpaces.replaceAll(" ", "")

View solution in original post


All Replies
Community Manager

Re: how to remove white space for integer column values in talend

Yes, this is pretty straight forward. Just place the following code in a tMap (or similar)....

 

row.columnWithSpaces.replaceAll(" ", "")

View solution in original post

Eight Stars RAJ
Eight Stars

Re: how to remove white space for integer column values in talend

Hi

I tried it's not working for integer column

 

row1.S_NO.replaceAll(" ","") 

Thanks
RAJ
Community Manager

Re: how to remove white space for integer column values in talend

This is not an Integer column if it has a space in it or starts with a 0. A number cannot start with a 0 unless it is 0. What you have is a String column which holds your data as "  0000 ". You need to remove the spaces in the way I demonstrated, and that will leave "0000". If you convert that to an Integer it will leave 0. 

Eight Stars RAJ
Eight Stars

Re: how to remove white space for integer column values in talend

Hi

Thank you for your help

Thanks
RAJ

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