Read Doc File

Hi all,
I try to ready DOC file using the following code but i face the folowing error.
IS there any way to read DOC or DOCX files?
declare
f utl_file.file_type;
s varchar2(200);
begin
f := utl_file.fopen('OUTPUT','x.doc','R');
utl_file.get_line(f,s,4000);
dbms_output.put_line(s);
UTL_FILE.FCLOSE(f);
exception
when NO_DATA_FOUND then
utl_file.fclose(f);
end;
SQL> /
declare
ERROR at line 1:
ORA-29284: file read error
ORA-06512: at "SYS.UTL_FILE", line 106
ORA-06512: at "SYS.UTL_FILE", line 746
ORA-06512: at line 7
SQL>
Many Thanks

thanks EdStevens ,
Also i try to used this but the results in different charachters.
CREATE TABLE LOB_TABLE4
LOB_ID INTEGER,
lob_name VARCHAR2 (100 BYTE),
CLOb_COL CLOB
DECLARE
L_CLOB BLOB;
L_BFILE BFILE;
BEGIN
L_BFILE := BFILENAME ('LOB_DIR', 'file.doc');
DBMS_LOB.OPEN (L_BFILE, DBMS_LOB.FILE_READONLY);
L_CLOB := DBMS_LOB.SUBSTR (L_BFILE, 1, 2000);
INSERT INTO LOB_TABLE4 (LOB_ID, LOB_NAME, CLOB_COL)
VALUES (1, '1st Row', UTL_RAW.CAST_TO_VARCHAR2 (L_CLOB));
COMMIT;
END;
SELECT DBMS_LOB.SUBSTR (CLOB_COL, 1000, 1) FROM LOB_TABLE4;
SQL> /
the result as follow:
DBMS_LOB.SUBSTR(CLOB_COL,1000,1)
╨╧◄αí▒→ß > ♥ ■  ♠ ☺ . ► 0 ☺ ■    -
                                ∞Ñ┴ ♥Ç ♦ ≡↕┐ 0 ♫ bjbj┤V┤V
♦▬ 4♫ ╓<☺ ╓<☺   ☼   ☼
  ☼ ╖ û♣ û♣ ┘↕ ┘↕ ┘↕ ┘↕ ┘↕ ¶
     φ↕ φ↕ φ↕ φ↕ ♀ ∙↕ ♀ φ↕ σ¶ 0☺ ♣‼
DBMS_LOB.SUBSTR(CLOB_COL,1000,1)
♣‼ ♣‼ ♣‼ ♣‼ ⁿ‼ ⁿ‼ ⁿ‼ d¶ ☻ f¶ f¶
f¶ f¶ f¶ f¶ $ §▬ ó☻ ╖↑ : è¶ § ┘↕
ⁿ‼ ⁿ‼ ⁿ‼
SQL>
i don't know why? but when i used to .txt it's working no problems but this problem with word file.

Similar Messages

  • How to read doc file

    hi friends,
    i want to read doc file and write it into test file. is their any direct/indirect method for it. i have tried getByte() method but it also write some illigal character also.
    waiting for response.
    alok

                InputStream source = new FileInputStream("your doc file");
                OutputStream destination = new FileOutputStream("your file to write to");
                byte[] buffer = new byte[1024]; // or whatever size suits you
                for (int len = 0; (len = source.read(buffer)) >= 0;)
                    destination.write(buffer, 0, len);
                source.close();
                destination.close();
    [/cpde]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to read .doc files on 5800 express music? pls ...

    When I try and open my .doc files it says file format error or something... Recently installed Office on my phone... New to this... please help...

    Are you sure the Office you downloaded was compatible?
    If you find my post helpful please click the green star on the left under the avatar. Thanks.

  • Reading .doc files on a mac

    I transferred my old PC Windows .doc files from my PC to an external hard drive but they will not open on a mac, the page is blank. Can I change the file extension to read them or do I have to use a program?

    TextEdit has no problems with any .doc files I have thrown at it. Because most word processors are more sophisticated than TextEdit, there may be formatting it has trouble reproducing, but I haven't had that issue. It certainly opens much faster than Word or even NeoOffice, which I also use, when you need a quick peek or read through. It also can save a document in Word format.

  • How to read .doc files using jakarta POI api......

    Hi all,
    I've googled a lot on reading the file contents of an MS word file. I couldn't get a solution yet. Can you please give some sample codes for using the POI api for extracting only the text contents from an MS word file.
    Thanks and Regards,

    whenever i click the folders, it's taking
    to the internal folders. but there's no
    option to download the whole package.Thats because you're looking at a tool which displays the contents of an svn repository through a web site.
    What you need is a subversion client (the repository is a subversion repository).
    There are several easy to use clients available:
    Here's two:
    1) subclipse: If you use eclipse. Dammed great tool IMHO. http://subclipse.tigris.org/
    2) tortoise svn http://tortoisesvn.tigris.org/
    When you've got a client, you'll need to give it a repository URL from which to check out.
    For the POI project, that URL is http://svn.apache.org/repos/asf/jakarta/poi/trunk/
    ~D

  • Read doc file using the Word Binary file format

    I want to be able to parse a Word file (xyz.doc).I want to be able to get to the actual text in the file and also get the "document properties" associated with this file.(This is the stuff you enter when you hit the File>>Properties button in Word)
    I have the binary file format of MS word 6.0 and I suppose these "document properties" are stored within a segment in this file format.
    Can anyone help me identify which segment in the Microsoft Binary word format this will be in???
    (Ya and ofcourse I want to achieve all the parsing purely in Java!!..)
    Thanks,
    Supriya

    IF you use MFC, yes. Don't ask how, this is the Java
    forum. As to the JAva API, no. There is no API in Java
    to deal with Microsoft docs, this is Java, not
    Micorsoft. Ya I know that!!:P
    You can write your own code, using the
    information in the doc. The info you refer to is
    locted on the header portion. As to how to read it,
    best go to a Microsoft forum. Once you understand the
    format, then post any Java related questions here,
    i.e. how do I oppen a file to read/write etc. Good
    luck, you will need patience, but you will leran a
    lot...Thanks anyway for your reply!:)..Will try with patience

  • Unable to read .doc files

    When someone sends me a Microsoft Word file with a .doc extension, I can't open it. Is there any way to do this without spending the $400 MS wants to buy Word?

    TextEdit found in your Applications folder will open Word documents.
    bill
    1 GHz Powerbook G4   Mac OS X (10.4.8)  

  • Re: problem in reading doc file

    if(fileName.endsWith(".doc"))
    outToClient.writeBytes("Centent-Type: application/msword\r\n"); !?

    There are no such methods in the JDK. Your question is therefore off topic. Evidently you are using some 3rd party Java Excel API. Ask them. Locking.

  • How do u read doc files in jdev

    need to load a cv and write the contents of the file into rich text editor...
    kindly reply

    Dear Sir...
    Can you please clarify your question? What do you mean by cv here? What jdeveloper you are using?
    best regards

  • Can't read email attachments that are .doc files

    Can someone help please. My dad has a PC and I have a G4. He sends me .doc and .xls files and I can't open them. I don't have any windows type software for my MAC. What should I do? Thanks for the help. The biggest problem today is trying to open a file that is .doc. Thanks, Pam

    Hi Pam and welcome to Discussions,
    TextEdit (in the Applications Folder) is capable of reading .doc files.
    For the future you might consider using NeoOffice for reading and editing .doc and .xls files.
    http://www.neooffice.org/neojava/en/index.php
    Regards
    Stefan

  • Installed iWork '09 on MacBook running OSX 10.7.2 and Pages won't open .doc files. Why?

    I just recently installed iWork '09 on MacBook running OSX 10.7.2 and Pages won't open .doc files.
    I did a search looking for a solution in the forums and here are the actions I've taken:
    1) Made sure the files were't read/write protected.
    2) Restarted the computer.
    3) Made sure all the program files were in the correct folder.
    4) Reinstalled the program.
    Pages won't read .doc files that were originally Pages files and exported as .docs
    It also won't read .doc files that were created using a relatively recent version of Office.
    Does anyone have any idea what's going on?
    Please help.

    If it's a doc created with the late Office 2011, it's not really surprising.
    The importer embedded in iWork application was delivered in january 2009 and didn't evolve.
    For this reason, it's unaware of new features delivered with Office 2011.
    Better try with LibreOffice.
    Yvan KOENIG (VALLAURIS, France) vendredi 3 février 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • To JDeveloper Tech Team & All: Displaying Microsoft Word Doc file in JDeveloper

    Is there any way, we can display a Microsoft Word Document file in JDeveloper ? I have JDeveloper 3.2.2 on my computer running Windows NT version 4.0 (SP 6). I appreciate your immediate responce. Thanks.

    In theory, you can display a DOC file in JDeveloper - given the correct JavaBean capable of reading DOC files and dispplaying it - then it could be hooked
    into JDeveloper as an Addin.
    But, wouldn't it be easier to display it in MS Word / other Doc Viewer?
    If DOC files are part of your development,
    then you can put a quick Invocation to Word / other tool in your JDeveloper Tools menu by editing the [JDev]\bin\tools.cfg file - See help for more info.
    I hope this helps,
    if not, please clarify further.
    -John

  • App that supports .DOC files?

    Does anyone know of any app that supports .DOC files? BadReader doesn't. Box.net doesn't. Pages definitely doesn't. I am going out of my mind here trying to find something to support well known Word formats. BadReader says it supports it, but when I try to open the file it says that it can't read it. Any help would be greatly appreciated.

    I've read both DOC and DOCX files in Goodreader ... Either something is wrong with your installation or with the documents themselves, I'd say. You might want to delete and reinstall the app.
    There also are 3rd party office suite apps that read DOC files ... Docs2Go or Office2.

  • How to open and read pdf and micrsoft word (.doc) files or documents

    My problem is how to use my BB 9800 software version 6.0.0.546 to read/view pdf files and microsoft office documents. I have also bought documents to go from online and have installed it on my phone, but whenever i try to open it I receive a message that it is incompactible. Any help will be greatly appreciated.

    Hi, Sammy.
    Why not install a 3rd party PDF reader and Word Doc reader to help open and read pdf and micrsoft word (.doc) files or documents? You can google it and select one whose way of processing is simple and fast to help you with the related converting work.  It will be better if it is totally manual and can be customized by users according to our own favors. Remember to check its free trial package first if possible. I hope you success. Good luck.
    Best regards,
    Arron

  • Read a doc file and write back to a doc file

    How to read line by line from a doc file and then arrange it.
    Like-->
    amit
    sumit
    prem
    jeev
    these four names are present in the doc file. Now how to read by means of java program and sort these names and write back to a new doc file?????
    What packages and methods are to be used??
    Please help.....
    Edited by: Jaguar on Apr 11, 2011 12:16 AM

    Jaguar wrote:
    How to read line by line from a doc file and then arrange it.By 'doc' do you mean MS Word?
    these four names are present in the doc file. Now how to read by means of java program and sort these names and write back to a new doc file?????You seem to have a sticky '?' key and an unreliable shift key (to apply an upper case letter to the start of every sentence). Please fix them.

Maybe you are looking for

  • Bug with using 2 certificates on a different port on the same machine

    There seems to be an issue with using secure connection to the same web location but on a different port. It is slightly difficult to recreate exactly but very often when one of the connections has been negotiated and the (self-signed) certificate ad

  • Adding a webcam to an iWeb site

    Hi, i have an old firewire Apple isight webcam, and was wondering if it was possible to use it to create a webpage with a webcam so i could view the plot of land out side of my house while i'm at work. If iWeb isnt the best tool for this what other s

  • Problem i loading jdbc connections , in JBOSS

    In my jboss , when i deploy and run my project, i am getting login page and when i give my uid and pwd and submit data, its throwing exception saying connectivity is not present. but when i refresh the same page and resend the data again its getting

  • Trying to format a newsletter

    I am completely new to all this and need to format a newsletter that we print on 11x17 and fold over.  Do I use Illustrator?  How DOES one format a newsletter?  Is there anyone who can walk me through this? HELP!

  • Disc Stuck in Intel iMac... STILL After Trying Literally EVERYTHING!

    It's been almost a month now and I still have a standard CD-R stuck in my disk drive. While my iMac is still useable, the disk drive cycles and taunts me every 4-5 seconds as it attempts to once again eject the disk. The battle has been fierce and I