Hi all,
I’m trying to create a mapping to translate a CSV format with parent-child rows into a flat CSV format.
My source file is structured like this:
Row Type | Order number | Customer name | Total Cost |
Header | 12345 | John Smith | $15.00 |
Row Type | Item code | Item name | Cost |
Line | 40123 | 5mm cable | $5.00 |
Line | 40124 | 10mm cable | $10.00 |
Row Type | Order number | Customer name | Total Cost |
Header | 12346 | Jane Lane | $10.00 |
Row Type | Item code | Item name | Cost |
Line | 40124 | 10mm cable | $10.00 |
Note that the actual file does not have headings, so looks like this:
Header | 12345 | John Smith | $15.00 |
Line | 40123 | 5mm cable | $5.00 |
Line | 40124 | 10mm cable | $10.00 |
Header | 12346 | Jane Lane | $10.00 |
Line | 40124 | 10mm cable | $10.00 |
I am wanting to convert this to a flat CSV structure that combines data from the parent header and child line rows. So the above would be translated to:
Order number | Customer name | Item code | Item name | Cost |
12345 | John Smith | 40123 | 5mm cable | $5.00 |
12345 | John Smith | 40124 | 10mm cable | $10.00 |
12346 | Jane Lane | 40124 | 10mm cable | $10.00 |
I would greatly appreciate any suggestions on how to do this, as I’m at a loss using the default CSV connectors and the documentation I’ve read suggests that it can’t be done that way.
Thanks,
Matthew
Best answer by Ankit Singh
View original