Say I have a text file with recipes fomatted like this:
TITLE: Michigan Pie:
INGREDIENTS: 8 oz cream cheese 1 can sweetened, condensed milk ¼ c lemon juice 15 oz crushed pineapple 8 oz whipped cream
DIRECTIONS: Drain the pineapple very well. Beat the cream cheese until it’s very smooth. Add the sweetened, condensed milk a little bit at a time. Mix in the lemon juice and pineapple. Fold in the whipped cream. Pour the mixture into two graham cracker pie crusts and refrigerate.
how could I use Python to sort all the titles together, all the ingredients together etc...??
1) Load all files, parse them and put then into a list of dictionnaries
2) Sort the list the way you want (see How do I sort a list of dictionaries by values of the dictionary in Python? )