bad format when converting RTF 2 Plain text (merged) [message #409400] |
Mon, 22 June 2009 07:52 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
keizersoz
Messages: 16 Registered: April 2006
|
Junior Member |
|
|
Hello,
I have some rtf fields in my database store as CLOB that I would like to convert to plain text. I have achieved doing that by creating an index and using the function CTX_DOC.FILTER.
However the problem is that I see many superfluous empty spaces and enters in my result, corresponding assumingly with the removed tags.
However, I do want to display empty rows resulting from the through value of the CLOB field. My sql code is as follows:
CREATE INDEX I_BR_CLOBS ON BILLING_REQUISITIONS(ADDITIONAL_TEXT)
indextype is ctxsys.context
parameters('DATASTORE CTXSYS.DEFAULT_DATASTORE FILTER CTXSYS.AUTO_FILTER');
CREATE OR REPLACE FUNCTION RTF_TO_PLAIN_TEXT(indexName VARCHAR2, primaryKey VARCHAR2) RETURN VARCHAR2
IS
mklob CLOB;
amt number:=500;
line varchar2(500);
BEGIN
CTX_DOC.FILTER(indexName,primaryKey,mklob,TRUE);
DBMS_LOB.READ(mklob,amt,1,line);
DBMS_LOB.FREETEMPORARY(mklob);
RETURN LINE;
END;
thanks for the feedback
|
|
|
Re: bad format when converting RTF 2 Plain text (merged) [message #434157 is a reply to message #409400] |
Mon, 07 December 2009 09:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/43710.gif) |
Barbara Boehmer
Messages: 9104 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
I know this is an old thread, but I see that it was not reponded to. I found it in the SQL and PL/SQL forum and moved it here to the TEXT forum where it belongs. Your problem is unclear. You said that you DO want to diplay empty rows. If so, then what is the problem? If you meant that you DO NOT want to display empty rows, then you can use the REPLACE function on your line variable to remove any spaces, tabs, double line feeds, or other characters, prior to returning the value of the line variable. You may need to check some of your results to see what all of thoe characters are and it may be easier to use their ascii values as chr(value) instead of copying and pasting them.
|
|
|