I have a Fixed Width text file that was downloaded from our mainframe.
There could be up to 5 different "Record Types" in this one text file, they are defined by the first field [Record Type].
Record Type Field_2 *
PA22109 0024057202402140346AN9A 2024021320240213PO
DE0E9D 3XS000001663250 01 0877
Each record type has a different set of columns. My goal is the get this flat text file into a readable Excel file so our staff can answer questions the client has regarding the data.
I THINK I want to use the RegEx Tool to help parse out the data in [Field_2] for each Record Type. I have no experience with RegEx so I've been scouring google looking for help to understand what I'm doing.
I got my PA line to parse beautifully when I manually enter the Format to Convert Regular Expression text box to: (.{2})(.{24})(.{7})(.{8})(.{4})(.{24})(.{8})(.{8})(.{1})(.{1})
My question is: Can I use a dynamic formula created field to enter this expression?
I've attempted to create a macro that has two input nodes, one for [Field_2] and the other for the formula field. I have one output node to display the parsed fields.
I'm getting two errors on the macro when I run the workflow:
1.
UpdateRegEx (15) Record #1: Tool #2: 11 Marked Groups were found, but 1 fields were defined.2. UpdateRegEx (15) The output connection "Output18" was not valid
I'm open to ideas to make this work. I can manually enter the string but I was hoping to make this more dynamic so the end user could define any file structure by supplying a separate schema document.
Thanks for your ideas!