Replace numbers in text document

happy_neid
happy_neid New Altair Community Member
edited November 2024 in Community Q&A

Hi everybody.

I have some text processing to do, and i am trying to replace all numbers with the word NUMBER. I used operator replace token, but i only sucsseded to replace each figure with that word, not the whole number. For example, 67 is replaced with NUMBERNUMBER, and i want it to ne NUMBER. How to do that?


Answers

  • IngoRM
    IngoRM New Altair Community Member

    Hi,

     

    You could transform your document into an Example Set first and use the regular "Replace" operator.  Here you can specify a regular expression like "\d+" (without quotes) and replace this with NUMBER.  Then you transform this back into a document.  This should do the trick...

     

    Hope that helps,

    Ingo

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.