Skip to main content
Question

Filter data

  • December 3, 2018
  • 2 replies
  • 14 views

dienstgeografie

I have a esri feature class, and one of the columns (populations) contains values in different formats, all in text (1234 | 1,234 | 123 txt | 12 txt. 34 | <Null>).

I want all the values in a new integer field.

Is there anyone who can help me to get rid of the text and (1234).

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.

2 replies

david_r
Celebrity
  • 8394 replies
  • December 3, 2018

Try a StringReplacer in regular expression mode. Text to replace:

 ^([0-9,]+)

Replacement text:

\1

This will leave only the first digits + commas at the start of the attribute.

0684Q00000ArLIwQAN.png

If you want to get rid of the comma you can use a second StringReplacer and leave the Replacement text empty:

0684Q00000ArLHXQA3.png


redgeographics
Celebrity
Forum|alt.badge.img+60
  • Celebrity
  • 3702 replies
  • December 3, 2018

I think a StringReplacer with this regex:

\(.+\)|\D

should do the trick. Replace the matches with nothing and you should be left with all digits as long as they're not between ()

Essentially the same as @david_r suggests, but in one go.