Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
How to read a Word file and parse data

Posted by Ramki (Ramki), 14 August 2007
Hi graham,
My query is as follows,
i have one word document , using perl i want open and parse some data from that word document, how to do that

Posted by KevinAD (KevinAD), 14 August 2007
May be something useful on cpan:

http://search.cpan.org/search?query=rtf&mode=all

Posted by admin (Graham Ellis), 14 August 2007
We have an example on our web site - see http://www.wellho.net/resources/ex.php4?item=p214/msword.   This uses the standard modules that come with ActiveState Perl.

Posted by Ramki (Ramki), 16 August 2007
on 08/14/07 at 23:10:11, Graham Ellis wrote:
We have an example on our web site - see http://www.wellho.net/resources/ex.php4?item=p214/msword.   This uses the standard modules that come with ActiveState Perl.


Thank you Graham,
i have run the code that is given in the ite that havebeen refererd by you,
when i run the program now i have been come up with the enw problem of " can't call methods on Paragraph on the undefined value at line 12"
Can you give me solution for that error
Thank you

Posted by admin (Graham Ellis), 16 August 2007
It will come up with an error like that if you don't give it a valid word document file name when you're asked, I think.

Posted by KevinAD (KevinAD), 16 August 2007
Yes, that looks to be the situation. When creating the object some error checking might be helpful:


Code:
$document = Win32::OLE -> GetObject($doc) or die "Invaild document $doc:  $!";


Graham,

Question: How come the sample code is not written using the strict pragma?


Posted by admin (Graham Ellis), 17 August 2007
on 08/16/07 at 20:19:17, KevinAD wrote:
Graham,

Question: How come the sample code is not written using the strict pragma?


Most of our sample code accompanies our training courses and is written to show the minimum functional elements necessary to perform a task. So that means that there's little or no validation and checking of all sorts in many of them.  You did spot a "user beware" paragraph in the conditions of use on the example, didn't you?  

The strict pragma is important in any files that you might use or require from within other programs, of course ... and we do use it, show you why and stress its importance when you're with us on your course.

Posted by KevinAD (KevinAD), 17 August 2007
hehehe... I missed the "user beware" disclaimer.

Your explanation makes sense.

Regards,
Kevin



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho