Jump to content


Photo

Converting .doc to php..... tearing my hair out!


  • Please log in to reply
11 replies to this topic

#1 ex gratia

ex gratia
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 July 2006 - 12:41 PM

Someone has sent me about 50 file written and saved in word as .doc files.

They want me to put them onto their php website as modules.

I have tried to download a doc to html converter and then convert the html to php but microsoft add so much GARBAGE to the doc file that it spits out errors.

I just want a simple way of uplaoding their .doc files to the modules folder and have it show up correct with right hand blocks etc....

help?  pleaseeeeeeeeeeee??? :-[

#2 ex gratia

ex gratia
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 July 2006 - 12:42 PM

OOps forgot to mention the PHP is a nuke site...



#3 designationlocutus

designationlocutus
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 24 July 2006 - 12:44 PM

Uh you poor soul! Try converting them to .txt files. That should strip the files of all the Word formatting.

#4 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 24 July 2006 - 12:51 PM

What ever way you look at it.
You have to do something to all files. Convert to Plain Text, not Rich text.
Copy and Pasting everything somewhere.

If it is just text, I think PHP can read the text from Word Docs.
If the files are named
doc01
doc02

just run a loop
for($i = 1; $i <= 50; $i ++){
Code for Grabbing text, and spitting it into a php file

}
Tell me the problem, I will try tell you the solution

#5 ex gratia

ex gratia
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 July 2006 - 12:53 PM

No converting them to .txt file removes ALL formatting.. which means I would have to go through and format it again... I may as well do that to the word file and then cut and paste into an index.php file for each module but it is taking AGES... and with 50 .doc files I could be here all month...

Why does microsoft fill the files with so much crud??

I just want a basic html file with basic formatting not all the junk...  *kicks Bill Gates**

#6 ex gratia

ex gratia
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 July 2006 - 12:55 PM

The guy added images to the files too and refuses to formet the files saying he hasnt time....

I asked him to do the basic <br> <img src=> etc etc... too much effort for him and now Im left with a doc file that i would either have to manually format or convert to word html and then remove all the junk...



#7 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 July 2006 - 01:26 PM

Demoronizer - http://www.fourmilab...ls/demoroniser/ - might do the trick

or download Microsoft's filter software - http://www.microsoft...&displaylang=EN

details on that - http://office.micros...0548651033.aspx

And most importantly, send the idiot a HUGE invoice.
Legend has it that reading the manual never killed anyone.
My site

#8 ex gratia

ex gratia
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 July 2006 - 02:07 PM

Alas while the demoroniser worked it didn't keep the formatting for the images and still didnt remove the microsoft rubbish so trying to find where the images are is taking as much time as me sitting here and reformatting it by hand... grrrrrr....

Thank you all anyway!

#9 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 24 July 2006 - 02:18 PM

Convert all the doc files to PDF and serve the PDF files.

Ken

#10 ex gratia

ex gratia
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 July 2006 - 03:10 PM

Well after what seems hours of faffing about I eventually loaded each file and images in their own folder and have them as htm files... it looks shoddy and not in keeping with the rest of the phpnuke site but I will go through them all one by one when i am less... vexed!

The PDF didn't work I kept getting errors that because the files had been sent as attachments they were not decoded.

I need a rather large wall to beat my rather sore head against...

WHY cant people learn simple formatting?? I sent him a simply sheet with basic formatting on it telling him that by the time he has highlighted text and clicked on bold he may as well type < b > around it.

he said it was too difficult to understand.

I wont be doing any more work for him unless he starts formatting.... this is NOT fun!

::) >:(

#11 ex gratia

ex gratia
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 July 2006 - 03:32 PM

YES YES YES!!!!

OK heres what i did....

created a modules folder in the phpnuke,
threw all the junk for that module in there... including the htm file
created an index file and added the following coding... spent the last 30 minutes tweaking it about but it works...

<?php
if (!eregi("modules.php", $PHP_SELF)) {
  die ("You can't access this file directly...");
}
$index = 1;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");
OpenTable();
include("modules/Antiage/Antiage.htm");
CloseTable();
include("footer.php");
?>

My only p[roblem now is the fact it isnt finding the images but rather leaving RED EX spaces... so I'll HAVE to faff about inside the microsoft coding and find where they are mentioned and img src them all...

But I did it!!!  kind of!

Yay to blondes!  lol

#12 ex gratia

ex gratia
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 July 2006 - 07:17 PM

All files done and dusted and the site looks fab!!

Downloaded arather nifty tool called:

PHP designer 2006

It was simpley the best to find the images and I had all 47 files re formatted and included in the phpnuke site in no time.. not sure what else the PHP designer does but it looks fab!

Thank you for all your help guys...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users