Jump to content

 
Photo

Removing numbers from Addresses in attribute field

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Jason JB

Jason JB

    Contributor

  • Validated Member
  • PipPip
  • 27 posts
  • Gender:Male
  • Location:Penang, Malaysia
  • Malaysia

Hi All,

I have a field for a point layer that has addresses (e.g 27 South Terrace) and would like to remove the number
and only retain the name of the street. Does anyone know a quick VB code to do this using the field calculator?

Thanks in advance!

#2
jmcandrew

jmcandrew

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Pennsylvania
  • Interests:Live Music, Travel, Bicycles, Photography
  • United States

Hi All,

I have a field for a point layer that has addresses (e.g 27 South Terrace) and would like to remove the number
and only retain the name of the street. Does anyone know a quick VB code to do this using the field calculator?

Thanks in advance!


try this code:

input = [YOUR_FIELD]
x=1
start = 1
do while x < len(input)
code = asc(mid(input,x,1))
if (code < 48 or code > 57) then
start = x
exit do
end if
x=x+1
loop
output = trim(mid(input,start))


and set your field to = output

#3
Jason JB

Jason JB

    Contributor

  • Validated Member
  • PipPip
  • 27 posts
  • Gender:Male
  • Location:Penang, Malaysia
  • Malaysia

Thanks! Works like a charm :)

Hi All,

I have a field for a point layer that has addresses (e.g 27 South Terrace) and would like to remove the number
and only retain the name of the street. Does anyone know a quick VB code to do this using the field calculator?

Thanks in advance!


try this code:

input = [YOUR_FIELD]
x=1
start = 1
do while x < len(input)
code = asc(mid(input,x,1))
if (code < 48 or code > 57) then
start = x
exit do
end if
x=x+1
loop
output = trim(mid(input,start))


and set your field to = output






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->