  johnnyboyct
join:2003-06-11 Newington, CT
·Cox HSI
| Convert crap to tables or something?
Hey guys, Ive got a small side job for a resteraunt, they want me to put up like 20 menus. I said yeah fine, ill work something out. Look at the file.. This could take days lol, anyone have an automated way or some tips?
John -- Connecticut Web Design and Development |
|
  JAAulde yum yum yum yum yum Premium,MVM join:2001-05-09 Hagerstown, MD
·Verizon Online DSL
| I don't really see the difficulty...the file you presented suggests a two or three table setup.
Table 1 - Menu Categories ID, Name, (etc...)
Table 2 - Menu Items ID, Name, Price, Description, Category ID, (etc...)
If you run into items falling into more than one category, a drop the Category ID column from Table 2 and add a 3rd table:
Table 3 - Item To Category Matching ID, Menu Item ID, Menu Category ID
Once your tables are setup, it should only take a couple hours (for which you're billing). -- No eat apple, eat cookie. Apple spoil dinner.
My Development Sandbox | Blessed Beyond Reason | LinkedIn Profile |
|
  johnnyboyct
join:2003-06-11 Newington, CT
·Cox HSI
| Hehe, If it was only that simple 
First off, Im not billing. I had my baby shower there for free, which really, seeing as they are getting Joomla and an original hand coded template, kinda sucks for me. But I had to do it, long story.
Second, I had a baby, I get like 5 minutes at a time if Im lucky lol.
Third, thats about 1/8 of 1 document, there are about 20... All in this
Something . . . . . . . . . Crap format Next crap . . . . . . . . . Above line 2, but i cant tell lol
And last, Im now spoiled, I haven't done data entry in a long time Closest is "hey, reformat this to a spreadsheet like this, then ill import it with navicat" lol
It sucks, Im trying to find a wysiwig or something that will be smart enough when I paste, but I bet that slim and none I even was thinking regex or SOMETHING, but that wont work, at least easily.
Any ideas? -- Connecticut Web Design and Development |
|
  jayco437 Premium join:2001-08-11 Lincoln, NE
·Windstream
·AT&T Southwest
| reply to johnnyboyct Ugly formatting in there. You *might* try dropping it into either Excel or OpenOffice and maybe you'll get lucky. I think the time spent on a regex would probably be wasted since it appears the text has some wrapping and line issues in it.
Maybe you could draw the tables in Word then copy into excel?
You could try using mechanical turk or Elance as well if you're really pressed for time. |
|
  marigolds Gainfully employed, finally Premium,MVM join:2002-05-13 Saint Louis, MO
edit: September 27th, @01:45PM
| reply to johnnyboyct I am going to use microsoft word syntax here. Obviously use only the text between the quote marks for your search and replace arguments. 1) Clear all tab stops Now you get rid of the dot lines 2) Replace ". " with " " 3) Replace " ." with " "
Then you convert whitespace to single tabs 4) Replace " "(two spaces) with " " (one space) 4) Replace " "(two spaces) with "^t" 5) Replace "^t " with "^t" 6) Replace "^t^t" with "^t". Repeat until you have 0 replaces left.
Finally, you need to catch missed line breaks (there was one in your doc). Use the following two replaces.
7) With wildcards on, replace ".[0-9][0-9] " with "^&xxx" Now turn off wildcards. 8) Turn wildcards off again and replace " xxx" with "^p"
And finally, two cleanup steps. 9) Replace " ." with " " 10) Replace "^t " with "^t"
You will still need some cleanup on the description columns (some of the descriptions that should be in column 3 are in column 4 instead), but otherwise it should be pretty close. -- ISCABBS - the oldest and largest BBS on the Internet telnet://bbs.iscabbs.com Professional Geographer Geographic Information Science researcher |
|
 muiredised ESSE QUAM VIDERI
join:2007-06-11 Tacoma, WA
·Vonage
edit: September 27th, @07:16PM
| reply to johnnyboyct Probably several approaches, and I am on Linux so my approach may be different from someone on win32. That being said... what I would do is re-save as rich text (.rtf), then I would use Perl to reformat. Specifically I would use the rtf2html program that comes with the RTF::HTML::Converter module. It spits out this for your example:
I could then take it a step further and use HTML::Parser to throw the data into a structure and then pass it to Template Toolkit to reformat it in any manner I chose. The tricky part would be the order in which the elements get put into the data structure because of the funky formatting.
My two cents.
-- Assiduus usus uni rei deditus et ingenium et artem saepe vincit |
|
  Dersgniw Disco Crunchin Premium,MVM join:2001-08-10 behind you clubs:
·Optimum Online
| reply to johnnyboyct I know of a menu site around here that simply scans in the menu as images and you click on the image to change the page.
You could also save as HTML in MS Word. The HTML code sucks, but it looks fine.
Yes, those are the easy ways out, but you can make it look respectable and the owner gets off cheap. -- I Smell Cures! -- Our Hope |
|
  tao Chaos Impends Premium join:2000-12-03 Lansing, MI edit: October 1st, @11:47PM
| reply to johnnyboyct nm |
|
  theedj Right Back At-Cha Premium join:2002-12-12 Calgary clubs:
| reply to johnnyboyct I have a custom developed PHP solution that the restaurant self-manages. Easily skinable and all. See it in action at »bravabistro.com/menus.php or wine list at »bravabistro.com/wines.php - I've been meaning to recode a few aspects of it, but the best part is they maintain it and I never need to interfere! -- # a b c d e f g h i j k l m n o p q r s t u v w x y |
|
 muiredised ESSE QUAM VIDERI
join:2007-06-11 Tacoma, WA
·Vonage
| Unless your PHP solution allows the OP to upload the .doc files and automagically import the data you may have misunderstood the request. Regardless of what framework the OP puts the data into, it still has to be extracted from the current format (Word files). As I understand the post, what is desired here is an automated way to get the data out of the Word files into a (more) usable format. -- Assiduus usus uni rei deditus et ingenium et artem saepe vincit |
|
  usa2k Please PRAY for Rebekah Premium,MVM join:2003-01-26 Canton, MI clubs: | reply to theedj Your links seem unreachable here! |
|