Skip to main content
Solved

Filter Odd and even Number


boubcher
Contributor
Forum|alt.badge.img+11

Hello Guys

we need to filter thousand of address into Odd and even number,

we are using the test filter, I think we should use the reg expression for the condition,

any idea how to write the expression

Thanks

Best answer by ebygomm

This will match any odd number

^\d*[13579]$

But I'd probably just use a tester/testfilter

0684Q00000ArLlaQAF.png

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

5 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • Best Answer
  • July 8, 2020

This will match any odd number

^\d*[13579]$

But I'd probably just use a tester/testfilter

0684Q00000ArLlaQAF.png


mark2atsafe
Safer
Forum|alt.badge.img+44
Try the ParityFilter on the FME Hub, though I haven't updated it in a long time so it may not be as fast as newer methods.

mark2atsafe
Safer
Forum|alt.badge.img+44
mark2atsafe wrote:
Try the ParityFilter on the FME Hub, though I haven't updated it in a long time so it may not be as fast as newer methods.

Actually it uses the same fmod function as ebygomm and someone kindly updated the transformers for 2019, so it should be good to use.


Forum|alt.badge.img+2

@boubcher FME functions will usually be faster than regex


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • July 8, 2020
ebygomm wrote:

This will match any odd number

^\d*[13579]$

But I'd probably just use a tester/testfilter

0684Q00000ArLlaQAF.png

@ebygomm

could please tell in test condition  

the left value is the att to test 

what is the condition?

and the right value ?

I know its basic thing but I am confused

Thanks

 

 


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