I am trying to make a program that makes a meal plan and shopping list for the week, from a set of predefined recipes.
The way it works is that I have a excel document with the different recipes, ingredients and how much of each ingredient. Then the program makes a list of X different recipes and combine all the ingredients to a shopping list.
So, in the end I have 2 arrays. One being a text array with the name of the ingredient and the other a numerical array with how much of each ingredient.
Here is my problem. I would like to delete duplicates on my text array and then add the numbers together on the numerical array. I will try to formulate an example below.
I have one text array with the items eg: [Milk, Flour, Sugar, Milk, Milk, Ketchup] and another with the numbers of how many pieces of the items I want to buy eg: [1, 1, 2, 3, 1, 1].
In this example I would like to sum up all the entries of milk, so I would end up with [Milk, Flour, Sugar, Ketchup] and [5, 1, 2, 1]. I hope this makes sense.
Solved! Go to Solution.
How will you combine all of the different units of measurement that could be used for recipes and convert that into a store bought unit? For example, milk is typically measured in cups or mL but it bought in gallons or liters. If one recipe uses cups and another uses mL, you'll need a conversion factor to be able to combine them. Just something to consider.
Is this a practical application that you plan to use at home or is it a school project?
Please find the attached VI that gives you the required solution.I have used a VI from OpenG Library and I have attached it too.
Hope it helps, Let me know if my understanding to your problem is right.
Click KUDOS and Mark as Solution to convey Thanks
Hey aputman, that is a good point. I think that I will start with getting it to work with just being consistent with my units in my recipe spreadsheet and only using liters for milk and so on.
This is just a fun project for home, but if it comes to work really well then I might use it to do my weekly meal and shopping plan.