Field calculator - replace values

2830
2
Jump to solution
07-20-2015 05:04 AM
JohannesBierer
Occasional Contributor III

I would like to have only the numbers out of a string like this: 083310-0002-815/0000.001?

Whats the best possibility?

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi Johannes,

You can do this using the re.sub function.  Ex:

import re

def update(field):
  return re.sub('[-/.]', '', field)

screen1.PNG

View solution in original post

2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Johannes,

You can do this using the re.sub function.  Ex:

import re

def update(field):
  return re.sub('[-/.]', '', field)

screen1.PNG

JohannesBierer
Occasional Contributor III

Great, thanks

0 Kudos