Save regex capturing group for use later

mdale9
mdale9 New Altair Community Member
edited November 5 in Community Q&A
Hi,
I'm reading in multiple sheets from an excel file and the first element contains an identifier for the data rather than an attribute name.  I'm using "Rename by Replacing" to change the attribute name to something more appropriate but I'd like to keep the regex capture response for later use when I create an new attribute and start to append all the sheet processing results together.
I've looked at logging and extracting to macro but the logging only logs the regular expression, not the result of the regex operation.

Any ideas?

Best Answer

  • BalazsBarany
    BalazsBarany New Altair Community Member
    Answer ✓
    Hi!

    I guess the following could work.
    Loop Attributes
    Inside Loop Attributes: Generate Macro with the regexp replace result. Rename using the generated value. Save the original and changed values, e. g. by appending the result of Generate Data by User Specification to an example set.

    Regards,
    Balázs

Answers

  • BalazsBarany
    BalazsBarany New Altair Community Member
    Answer ✓
    Hi!

    I guess the following could work.
    Loop Attributes
    Inside Loop Attributes: Generate Macro with the regexp replace result. Rename using the generated value. Save the original and changed values, e. g. by appending the result of Generate Data by User Specification to an example set.

    Regards,
    Balázs
  • mdale9
    mdale9 New Altair Community Member
    Hi,

    Thanks for that, finally got it to work.