Skip to main content
Solved

delete first char if that is zero or space


rakeshreddy0996
Forum|alt.badge.img

I have House number field but some of values are not valid like start with zeros and spaces

need to remove zeros or spaces from red highlighted columns

Best answer by jdh

You can use the AttributeTrimmer with Trim Type: Left

 

 

There is both a space and the 0 character in Trim Characters.

View original
Did this help you find an answer to your question?

7 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • August 29, 2019

You can use the AttributeTrimmer with Trim Type: Left

 

 

There is both a space and the 0 character in Trim Characters.


rakeshreddy0996
Forum|alt.badge.img

could u please give brief... ?


sipsysigh
Contributor
Forum|alt.badge.img+7
  • Contributor
  • August 29, 2019

Hi,

Edited so that it works now! Sorry for any confusion...

You can use a StringReplacer with the following parameters.

StringReplacer Parameters

The Text To Replace uses RegEx to search for zero or more white space characters and zero or more '0's at the start of the string. The Replacement Text will then replace the matched whitespace and / or 0s and with nothing.

Hope this helps!

Thanks,

Simon


sipsysigh
Contributor
Forum|alt.badge.img+7
  • Contributor
  • August 29, 2019
rakeshreddy0996 wrote:

could u please give brief... ?

As @jdh has said, you can use the AttributeTrimmer. Try with the following parameters:

Your Trim Characters would be a 'space' and '0'

I completely over thought my solution! @jdh has provided a nice straightforward solution. Mine got a little RegEx-y. However, both solutions do what you want, so it's up to you!


rakeshreddy0996
Forum|alt.badge.img

oky sir thank you....

but it delete all zeros in field like

0100 is give only 1 but i need value 100.

 


rakeshreddy0996
Forum|alt.badge.img
sipsysigh wrote:

Hi,

Edited so that it works now! Sorry for any confusion...

You can use a StringReplacer with the following parameters.

StringReplacer Parameters

The Text To Replace uses RegEx to search for zero or more white space characters and zero or more '0's at the start of the string. The Replacement Text will then replace the matched whitespace and / or 0s and with nothing.

Hope this helps!

Thanks,

Simon

bro one more querry,

i work on zeros only leave spaces as it is


takashi
Influencer
  • August 29, 2019
rakeshreddy0996 wrote:

oky sir thank you....

but it delete all zeros in field like

0100 is give only 1 but i need value 100.

 

What kind of regex did you use?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings