Using the text parser module is there a way to take the following string and output multiple groups (for the text after the colon on each line) in a single bundle?
Job Number: 82722
Contact First Name: John
Contact Last Name: Smith
Contact Email: j.smith1000@gmail.com
Contact Mobile: 0400 000 000
Contact Address1: 100 Fake Beach Drive
Location Address2:
Location Suburb: Fakeburbs
Location State: QLD
Location Postcode: 4000
Ok yeah that works! Thanks, saves me a lot of hassle not having to aggregate and mess around with no labels!
Do you know of a way to do the same thing but not have to be an exact match on the full string? For example, if one was missing or it was in a different order?
When you say “exact match” on the full string you’ll need to define some sort of pattern you want to match that is not exact and then encode that into the regular expression. The missing and different order all use modifiers like ? or look ahead/behind modifiers and make for a more complex string. If you need help share what you have and one of the regex geeks will jump in.
Thanks, Alex. I’m familiar with regex but not an expert.
To add some clarity to what I’m trying to achieve:
Using an OR operator, I’m able to get it to do what I want – match each item, regardless of order or if it exists – however, it outputs each match as a separate bundle which means I then need to aggregate it
Using the following regex, I can get a single bundle but only if every item is present and in that exact order
Job Number: \s*(?.)\nContact First Name:\s(?.)\nContact Last Name:\s(?.)\nContact Email:\s(?.)\nContact Mobile:\s(?.)\nContact Address1:\s(?.)\nLocation Address2:\s(?.)\nLocation Suburb:\s(?.)\nLocation State:\s(?.)\nLocation Postcode:\s(?.*)
Looking for a solution that allows the flexibility of (1) but only outputs a single bundle as per (2)
Why don’t you just use an array aggregator module after the text parser to combine all the output bundles into one array that way you can deal with them as one array in subsequent modules rather than separate bundles?
I spent a heap of time playing with the array aggregator and the other various aggregators but what happens is the array aggregator spits out something like this: