Save regex capturing group for use later
mdale9
New Altair Community Member
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?
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?
0
Best 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ázs1
Answers
-
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ázs1 -
Hi,
Thanks for that, finally got it to work.
1