Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
stephbzr
Contributor III
Contributor III

Remove spaces before a string

Hello,

After reading the data in CSV, I need to remove spaces. 

I tried the advanced settings option "remove spaces at beginning and end of field..." of tFileInputDelimited, but it removes spaces after, I want only spaces before. Being new to java, I tried the stripLeading() method I found, but without success.

Is there a component or another java method I can use in tjava or another component?

0695b00000SssBNAAZ.png 

Thank you for your help

1 Solution

Accepted Solutions
gjeremy1617088143

Hi @Stéphane Barbezier​ 

StringHandling.FTRIM("your string here")

Send me love and kudos

View solution in original post

4 Replies
SMR040
Contributor III
Contributor III

Have you tried the Trim function?

 

https://help.talend.com/r/en-US/8.0/data-mapper-functions-reference-guide/trim-function

gjeremy1617088143

Hi @Stéphane Barbezier​ 

StringHandling.FTRIM("your string here")

Send me love and kudos

PeggieP
Contributor
Contributor

I am also having the same Issue. Did you get any solution?

 

stephbzr
Contributor III
Contributor III
Author

Yes it works very well, thank you  @guenneguez jeremy​ 

@Couch Lisa​ I used the solution in a tJavaRow , but you can also use it in a tMap.

0695b00000SsykOAAR.png