Hi all,
I'm not too sure where to begin with this one.
Background:
I have a list of recipes that I'm attempting to split out in to a database. In order to do this I wish to first split out the ingredients from the recipe so I can attach other values to them in their own table.
What I'd like to achieve in excel:
Each recipe takes up a single line in my spreadsheet. I have the data cleaned up quite well, but the ingredients are in a single cell, each ingredient separated by a CHAR(10) line break. Occasionally the next line might start with a space (still working on this..). Each recipe has an index # in column A. I'd like to break up the contents of the ingredients cell so that each ingredient is copied to a separate line in the destination sheet, and each ingredient has next to it the index # from column A. My thinking is that this will form the primary/foreign key component that links the ingredients to the recipe when they are brought in to the DB.
There's a lot of recipes to loop through - about 10,000 at the moment
I've attached an example xlsx file with 2 recipes in a source sheet, and how I'd like to wind up with them in the destination sheet.
I'd have had a crack at the code, but the holdup is breaking the ingredients out to their own cells - step 1. Sorry.
Thanks for any help!
Index Ingredient 00000001 Apple
Orange
Pear00000002 Pumpkin
Flour
Water
Goes to
Index Ingredient 00000001 Apple 00000001 Orange 00000001 Pear 00000002 Pumpkin 00000002 Flour 00000002 Water
Bookmarks