I get a text string from a scanned receipt. Here are couple of examples:
George's Restaurant 300 72th Street Miami Beach fl 33141 305-864-5586 Server: Ronald 01/19/2013 Table 20/1 10:53 PM Guests: 1 10062 Reprint #: 1 Ferrari Carano Insalate Cesare Caprese with prosciutto FISH SPEC Spinach Ricotta Ravioli Seafood Pasta Ossobucco 47.00 7.50 9.50 25.95 15.95 19.95 29.95 Sub Total Tax 155.80 14.02 Total 169.82 169.82 Balance Due GRATUITY NOT INCLUDED!!! Thank you for your business
How do I identify what the total amount is in each case (169.82 and 52.88)?
I was thinking I can remove all non-numeric characters, split remaining into array and look for the largest. But it can get confusing with address and phone numbers. I suppose I need to make sure the word TOTAL, SUB-TOTAL, or AMOUNT DUE is close by.
Any suggestions? Thanks.
Another example:
933 ece tur New OrlerS LA 70116 504.:25.1602 wwwfranksresta.ratnewor leans.com 219 KATHY U che 1750 Feb03'1 (7:-2PM Tbl 6/1 Gst 4 1 GARLICBREAD 2 Diet 2 Iced Tea 2 TASTE OF NO 1 Whole Muff 1 Alfredo 3,95 6.00 6.00 33.90 14.95 14.95 Food Tax TOTAL DUE 79.75 7.78 87.53
UPDATE:
It appears I need to look into neural networks to solve this.