Select addresses that don't have street numbers

356
2
Jump to solution
08-17-2022 06:35 PM
CherylCollins
New Contributor III

I want to QA the address field in my table by removing records that don't have a street number anywhere in the cell.  Because StreetMap Premium can use a street number that is not at the beginning of the cell, I still want to keep records in which the number is after the street name, so simply sorting or using "begins with" is not an option.  I've tried selecting by using "has value(s)" and "doesn't have value(s)," but I keep getting 0 records selected.  So for example, if the cell has

Smith Ave 226

how do I come up with a way to either select that record so I can invert the selection or select records that don't have any numbers?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
CherylCollins
New Contributor III

Thanks for the suggestion.  I didn't get a chance to check it out because I discovered that what I was doing wrong was using "does not include the value(s)," when I should have been using "does not contain the text" because the address field has both letters and numbers.

View solution in original post

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

You can use several options

python - Check if a string contains a number - Stack Overflow

but you could try

 

a = 'Smith Ave 226'
# `a` is your field

any([i.isdigit() for i in a])

True

will give you records that have a number, either `not` the above or switch the selection

 


... sort of retired...
CherylCollins
New Contributor III

Thanks for the suggestion.  I didn't get a chance to check it out because I discovered that what I was doing wrong was using "does not include the value(s)," when I should have been using "does not contain the text" because the address field has both letters and numbers.

0 Kudos