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(" ", "")

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(" ", "")
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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

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

Download