LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-06-2009, 05:47 AM   #1
sriphp
Member
 
Registered: Apr 2009
Posts: 48

Rep: Reputation: 15
reading ms word file on fedora


Hai all,

this is srinath.m

i am using fedora.

in my project task i want to read ms word file content and dump into mysql table field.

how to download ms word on fedora and how to install it on fedora

i am using php. how to read msword file to dump contants into mysql table field.

is file_get_contants function is sufficiant?

please help me

Thanks
Srinath.M
 
Old 05-06-2009, 06:57 AM   #2
John-in-France
Member
 
Registered: Jun 2006
Posts: 65

Rep: Reputation: 15
Use OpenOffice - available on Fedora - that reads MS Office files although sometimes the format is a little scruffy.

John
 
Old 05-06-2009, 07:18 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Abiword will also read MSWord files.

But--you are talking about putting the contents into a "mysql table field". Do you mean the whold MSWord file, or just some specific data?

Please post an example of what you are trying to do.

Quote:
how to download ms word on fedora and how to install it on fedora
You have to buy MSWord and then install it using WINE or CrossOver. But--for most situations--just use OpenOffice.
 
Old 05-06-2009, 08:01 AM   #4
sriphp
Member
 
Registered: Apr 2009
Posts: 48

Original Poster
Rep: Reputation: 15
reading msword file on fedora

hai,

i need to read complete content in msword file and to insert in to mysql table field.

how to use openoffice for this purpose?

please tell me

Thanks
Srinath.M
 
Old 05-06-2009, 09:08 AM   #5
John-in-France
Member
 
Registered: Jun 2006
Posts: 65

Rep: Reputation: 15
Pixellany is right - reading an MS Word file using OpenOffice or ABIWord is the easy bit. Without knowing the format of the data in Word and the required format in the database, offering guidance is difficult. An example is essential.
 
Old 05-06-2009, 09:22 AM   #6
monsm
Member
 
Registered: Feb 2005
Location: London, UK
Distribution: Gentoo
Posts: 568

Rep: Reputation: 37
If I am understanding you right, you might want to have a look at: http://phpdocwriter.sourceforge.net/

It might be available on the Fedora package manager. Not sure if it will do all of what you want, you might need other things instead of or in addition. (search on google for "openoffice php").

Mons
 
Old 05-06-2009, 10:56 AM   #7
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
sriphp:

All you need to do is install (if it is not yet installed) an Open Office Suite. Usually this is auto installed in most distros.

Open Office writer reads MSWord format. I have no problem with my word files from windows to openOffice. Try OpenOffice v.3, though the previous v.2.4 is still used largely for being stable.

If you wanted to convert some msword tables into spreadsheet Open Office has also a spreadsheet program equally good as that of ms excel.

mySQL understands your files don't worry.

The best way of solving Linux problems is this ---
First, backup your system and data files;
Second, try some possible solutions out of the box;
Third, google for similar issues, and if none is found, ask Linux Questions but be sure post also everything what you have done and your current system condition.

Hope this helps.
 
Old 05-08-2009, 01:42 AM   #8
sriphp
Member
 
Registered: Apr 2009
Posts: 48

Original Poster
Rep: Reputation: 15
reading msword file on fedora

hai,

this is srinath.m

i downloaded word file from my yahoo mail account and i am using openOffice.

i am using fedora,php, mysql

i tried like

<?php
$conn = mysql_connect("localhost", "root", "srinath") or die("Could not connect : " . mysql_error());

mysql_select_db("newdb");

$file = "./fl.doc";
$fp = fopen($file, "r");
$data = fread($fp, filesize($file));
fclose($fp);

echo $sql = "INSERT INTO tblTest(Id, data) values (null, $data)";
mysql_query($sql);

?>

my query is

INSERT INTO tblTest(Id, data) values (null,

Dear Candidate,

We ar! e one of the largest recruitment companies in Chennai. We are looking for Software Engineer - PHP Professionals for our client who is in Software business in large scale at Chennai. Below mentioned are the details about the company and their requirements.

Pl inform about your interest in this job. If you're interested please send your updated resume with expected salary.



If your are not interested pls refer to your friend! .

Job Description for Software Engineer - PHP.


Position Vacant: Software Engineer - PHP.

Company Name: ESSENTIA SOFT SOLUTIONS PVT LTD.



Industry: Software

Company Profile: The Company is a privately held services company with offices in Chennai, India and Houston, Tex! as managed by seasoned test experts from Fortune 100 companies and successful Silicon Valley startups focus on Open Source and Software as a Service. The Company provides Software Lifecycle Services quality assurance, testing and certification services to global customers with a focus on Web-based Business Systems, Open Source Technologies and Software as a Service model. We have extensive experience in testing and maintaining very large hosted and enterprise deployments across a heavily utilized and widely dispersed user base. Our roots are in product development and lifecycle support of Enterprise products using J2EE, Rich Internet and Open Source products.


Job Description & Responsibilities:



*

3+ years of experience in PHP, CakePHP, Smar! ty.
*

Strong CMS experience (JOOMLA/DRUPAL/MAMBO, etc).
*

HTML, DHTML, JavaScript, CSS.
*

AJAX.
*

Database knowledge (SQL, Oracle, DB2).
*

Working knowledge in Linux OS.

Minimum Experience: 3

Maximum Experience: 10



Age & Gender: Below 32



Annual Salary: Very Attractive based on the experience

Location: Chennai


Education: Any Degree



Regards,



B.RAMIYA

CAREERZEAL HR MANAGEMENT SERVICES

CHENNAI-23

CONTACT NO: 43181219/43181279

E-mail: ramiya@careerzeal.in !

Web: www.careerzeal.in
);

when i run this query in webdb or phpmyadmin i got

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Candidate, We ar! e one of the largest recruitment companies in Chennai. We a' at line 3

for my task is another process is there? if so then please tell me i will try.

Thanks
Srinath.M
 
Old 05-08-2009, 02:45 AM   #9
sriphp
Member
 
Registered: Apr 2009
Posts: 48

Original Poster
Rep: Reputation: 15
reading msword file on fedora

hai,

i got solution just i used addslashes to file content and query run sucessfully.

Thanks
Srinath.M
 
Old 05-08-2009, 03:04 AM   #10
sriphp
Member
 
Registered: Apr 2009
Posts: 48

Original Poster
Rep: Reputation: 15
reading msword file on fedora

Hai,

this is srinath.M

i am still getting problum.

i downloaded another doc and opened with openOffice,its opening properly
it also shows images in the doc.

problum is when i inserted data of file into mysql (blob field) row is inserted but when i read that row and echoed it i am getting different characters and i am not getting contant at all, i am only getting header text.

how to solve this problum

Thanks
Srinath.M
 
Old 05-09-2009, 02:28 AM   #11
sriphp
Member
 
Registered: Apr 2009
Posts: 48

Original Poster
Rep: Reputation: 15
reading msword file on fedora

Hi all,

this is srinath.m

how to read ms word file contant (text only not header and format information) using openOffice functions.

i am very argent for this.please anybody know then tell me soon

please give one example code ,i am new to linux

Thanks
Sri
 
Old 05-11-2009, 09:04 AM   #12
monsm
Member
 
Registered: Feb 2005
Location: London, UK
Distribution: Gentoo
Posts: 568

Rep: Reputation: 37
Hi Sri,
You need to look up the openoffice support for php yourself (google "openoffice php"). There are some resources available for you to study. Ones you get into it, your best bet for help on specific functions is the openoffice website forum.

Mons
 
Old 05-11-2009, 09:17 AM   #13
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by sriphp View Post
Hi all,

this is srinath.m

how to read ms word file contant (text only not header and format information) using openOffice functions.

i am very argent for this.please anybody know then tell me soon

please give one example code ,i am new to linux

Thanks
Sri
You can open an MSWord document in OpenOffice, and then save it as text-only. Somewhere the must be a converter to do this.....try Google.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
reading ms word on linux sriphp Linux - Software 2 05-07-2009 05:02 PM
Reading and printing the 5th, 10th, 15th...word of any file dahr Linux - Newbie 2 07-28-2008 04:51 PM
[SOLVED] find a word in a file, and change a word beneath it ?? vikas027 Programming 10 02-14-2008 10:46 PM
problem reading arabic file names in fedora core 3 Yaan Linux - Newbie 1 05-21-2005 02:44 PM
problem in reading Microsoft word as a binary file ljqu_happy Programming 15 02-02-2005 11:10 AM


All times are GMT -5. The time now is 08:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration