Skip to main content
Solved

delete first char if that is zero or space

  • August 29, 2019
  • 7 replies
  • 281 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

jdh
Contributor
Forum|alt.badge.img+38
  • 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+12
  • 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+12
  • Contributor
  • August 29, 2019

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

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
Celebrity
  • August 29, 2019

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?