Text mining and content categorization

Extracting numbers embedded in text

Reply
Occasional Contributor
Posts: 5

Extracting numbers embedded in text

Does anyone out there have code to share that will help me to extract numbers out of a character variable that may or may not have numbers embedded in the observation?

Specifically, I just need to extract the street number out of a variable that contains the street address but no guarantee where the street number is embedded in the string or how many digits there are.

Thanks, in advance, for any help!

Respected Advisor
Posts: 3,773

Re: Extracting numbers embedded in text

Start with ANYDIGIT function and work from there.

Occasional Contributor
Posts: 5

Re: Extracting numbers embedded in text

Thank you!  This was very helpful to get me started.

Grand Advisor
Posts: 16,875

Re: Extracting numbers embedded in text

compress with kd option is also useful.

Respected Advisor
Posts: 3,773

Re: Extracting numbers embedded in text

What will COMPRESS KD give for "123 West 23rd"?

Ask a Question
Discussion stats
  • 4 replies
  • 489 views
  • 8 likes
  • 3 in conversation