Page 7 of 10
Re: MealMaster: Decoding text file format to database
Posted: Sun Jan 13, 2013 12:54 am
by infratec
I just found fdx files with multiple receipes inside.
Tomorrow I'll implement this.
Good night,
Bernd
(0:53am)
Re: MealMaster: Decoding text file format to database
Posted: Sun Jan 13, 2013 2:38 pm
by infratec
Hi Fangbeast,
I changed my code above:
Fixed FDX multiple recipes in one file.
Tried to fix RecipeML title for ingredients.
But since I have no file with this constellation, I can not test it.
About MealMaster:
we should have it, since it is the most used one.
About FDX:
should I extract the pictures in an extra directory ?
Bernd
Re: MealMaster: Decoding text file format to database
Posted: Mon Jan 14, 2013 10:41 pm
by Fangbeast
Bernd, the 'Now You're Cooking ingredients are getting cut apart at the wrong character like this:
1~me~dium onion; chopped|1~~jalapeno pepper; seeded and chopped,|~~optional|2~~garlic cloves; minced|1~ta~blespoon vegetable oil|4~cu~ps chicken broth|2 15 1/2~ou~nce great northern beans; rinsed and drained|2~ta~blespoons minced fresh parsley|1~ta~blespoon lime juice|1~te~aspoon ground cumin; (1 to 1-1/4)|2~ta~blespoons cornstarch|1/4~cu~p cold water|2~cu~ps cubed cooked chicken
Off by 2 characters somewhere?
me~dium
te~aspoon
ta~blespoon
cu~p
Re: MealMaster: Decoding text file format to database
Posted: Tue Jan 15, 2013 12:09 am
by infratec
Fangbeast wrote:Bernd, the 'Now You're Cooking ingredients are getting cut apart at the wrong character
Should be fixed now.
(I mixed up two different formats)
Bernd
Re: MealMaster: Decoding text file format to database
Posted: Tue Jan 15, 2013 3:48 am
by Fangbeast
infratec wrote:Fangbeast wrote:Bernd, the 'Now You're Cooking ingredients are getting cut apart at the wrong character
Should be fixed now.
(I mixed up two different formats)
Bernd
Thank you. I am busy fixing my own bugs before any more updates and so far, it looks good.
Could not have done this without you!
Re: MealMaster: Decoding text file format to database
Posted: Tue Jan 15, 2013 9:55 pm
by infratec
Hi Fangbeast,
next try to fix MealMaster format.
(Code changed)
But I have one recipe which still does not fit:
Title: BLUE CHEESE CHEESECAKE
Categories: Kooknet, Cyberealm, Cheesecake
Yield: 8 " cake
Crust:
2 T Butter or margarine 1 c Cheese crackers, crushed
: Filling: 16 oz Cream cheese, softened
8 oz Blue cheese
3 Eggs 1/4 c Flour 1/4 t Salt
1 c Medium picante sauce
1 c Sour cream 1/2 c Chopped green onions 1/2 c Chopped walnuts
: Garnish:
: chopped parsley
: tomato roses
: chopped green onions
Preheat oven to 325 deg. Butter 8-inch springform pan; sprinkle
cracker crumbs on bottom and sides.
etc.
At the moment no idea how I should handle this.
It has on some lines 3 ingredients.
I don't know what the colon at the start means.
But maybe it is a real malformed recipe.
Bernd
Re: MealMaster: Decoding text file format to database
Posted: Tue Jan 15, 2013 11:32 pm
by Fangbeast
next try to fix MealMaster format. (Code changed)
What a job that is. I once found the full specifiactions to the MealMaster file and it scared the hell out of me. The one I uploaded to box.com was the easy version!!!
But I have one recipe which still does not fit. At the moment no idea how I should handle this. It has on some lines 3 ingredients. I don't know what the colon at the start means. But maybe it is a real malformed recipe.
Probably is malformed. I made some 70 meg import files using the DOS MealMaster last year and then exported them. Then I tried to reimport them and MealMaster was rejecting duplicates or problem recipes from it's own export file so it wasn't perfect either.
I have 3*70 meg mealmaster export files but am afraid to try to import them as either RecipeMuncher seems to hang overnight when I use the 'commit' functions or the disk is hit just too hard without it.
Got another update to upload tonight, have streamlined just about everything, just building a better export window. Added full screen recipe picture view as well.
Re: MealMaster: Decoding text file format to database
Posted: Tue Jan 15, 2013 11:34 pm
by Perkin
Would this fit in with what you want to do? It uses a regex.
Code: Select all
text.s="Crust:"+#CRLF$
text.s+""+#CRLF$
text.s+"2 T Butter or margarine 1 c Cheese crackers, crushed"+#CRLF$
text.s+""+#CRLF$
text.s+": Filling: 16 oz Cream cheese, softened"+#CRLF$
text+"8 oz Blue cheese"+#CRLF$
text+"3 Eggs 1/4 c Flour 1/4 t Salt"+#CRLF$
text+"1 c Medium picante sauce"+#CRLF$
text+"1 c Sour cream 1/2 c Chopped green onions 1/2 c Chopped walnuts"+#CRLF$
If CreateRegularExpression(0,"(.+?\s.+?)(?=\s+\d|$)",#PB_RegularExpression_DotAll|#PB_RegularExpression_MultiLine)
Dim Result$(0)
NbFound = ExtractRegularExpression(0, text, Result$())
For k = 0 To NbFound-1
Result$(k)=Trim(ReplaceString(ReplaceString(Result$(k),#CR$,""),#LF$,""))
Debug Result$(k)
Next
Else
Debug RegularExpressionError()
EndIf
Re: MealMaster: Decoding text file format to database
Posted: Wed Jan 16, 2013 12:28 am
by Fangbeast
Perkin wrote:Would this fit in with what you want to do? It uses a regex.
No idea. regEx's scare me more than srod's used underpants or idle's diseased sheep (or my daughter's smelly socks!!), don't know how to use them without getting a head pain caused by a steel spike through the frontal lobe.
Brain, hurts, need more brain!
Re: MealMaster: Decoding text file format to database
Posted: Fri Jan 18, 2013 10:40 pm
by Fangbeast
Someone pointed out an accidental oversight in the latest code. I had left references in to a third party library.
Look for the line "XIncludeFile "RecipeMuncher_Windows.pb"", open that file and look for lines that begin with PV_ and delete them and it will work.
I was looking for a way to get option and checkboxgadget colours to work without a library and these options were a good way to go for me locally. Trying to find a way that works WITHOUT using a third party lib so everyone can use this.
Anyone else working on this program to help me out? (Hopeful look)
Re: MealMaster: Decoding text file format to database
Posted: Sun Jan 20, 2013 3:46 pm
by infratec
Hi Fangbeast,
I changed my code again:
MasterCook MX2 is added.
But be carefull, the recipe file which I have, has a wrong coded first line.
So I needed to implement a bugfix.
Bernd
Re: MealMaster: Decoding text file format to database
Posted: Mon Jan 21, 2013 3:53 am
by Fangbeast
Hi Fangbeast,
Hello Bernd,
I changed my code again:
Do you ever sleep???
MasterCook MX2 is added.
That's great, I was thinking about that.
But be carefull, the recipe file which I have, has a wrong coded first line. So I needed to implement a bugfix.
Is it a file Is sent you that I generated from RecipeMuncher? If so, it's a standard PB XML output.
Or is it a recipe I sent you that I found on the internet?
P.S. It's getting harder to find recipes to download, they all seem to be duplicates of each other.
I haven't been able to find any more FDX recipes except for the first 5. I wanted to implement base64 encoding and decoding for RecipeMuncher XML files and wanted more samples.
The 5 FDX files I had, contained thumbnail sized gif pictures when extracted. Not terribly brilliant.
Re: MealMaster: Decoding text file format to database
Posted: Mon Jan 21, 2013 8:10 am
by Fangbeast
Hello Bernd. The latest version with your new MasterCook 2 import has been tested and uploaded.
Been testing more with MealMaster and some recipes just go horribly wrong in the ingredients area so I suspect that they were done using a notepad rather than a proper export and we will just have to manually delete bad records.
There aren't many, maybe 1 out of every 50 (that I can see) but I am going to do another mass import tonight and see where the bad records are.
Thanks for all of your hard work. I found some BigOven recipes last night and they work on BigOven for my Android tablet.
Can't find much else that is downloadable, plenty for just copy and paste but I can't stay awake that long.
Re: MealMaster: Decoding text file format to database
Posted: Mon Jan 21, 2013 10:24 am
by Fangbeast
. More recipes needed
. Some feedback would be good!
. Has anyone tested RecipeFox and actually got it to work? Does nothing here.
P.s. Should I package and upload the entire 1.64 gig of uncompressed recipes somewhere?
Re: MealMaster: Decoding text file format to database
Posted: Thu Jan 24, 2013 2:54 pm
by jack
Fangbeast wrote: P.s. Should I package and upload the entire 1.64 gig of uncompressed recipes somewhere?
yes, I would love to have the full package.
