Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

RTF ( rich text format ) in sql

2 posts in General Discussion Last posting was on 2011-03-10 17:53:58.0Z
AK Posted on 2011-03-08 14:59:53.0Z
From: AK <ako@gmx.ch>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: RTF ( rich text format ) in sql
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4d764469$1@forums-1-dub>
Date: 8 Mar 2011 06:59:53 -0800
X-Trace: forums-1-dub 1299596393 10.22.241.152 (8 Mar 2011 06:59:53 -0800)
X-Original-Trace: 8 Mar 2011 06:59:53 -0800, vip152.sybase.com
Lines: 10
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8125
Article PK: 7143

hi all

I have the following problem:
- I have a field in a table with any text, but rtf formatted.

Now i want execute a select command who I can see the clear text.

Can anybody help me?

thx


Jeff Albion [Sybase iAnywhere] Posted on 2011-03-10 17:53:58.0Z
From: "Jeff Albion [Sybase iAnywhere]" <firstname.lastname@sybase.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: RTF ( rich text format ) in sql
References: <4d764469$1@forums-1-dub>
In-Reply-To: <4d764469$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4d791036$1@forums-1-dub>
Date: 10 Mar 2011 09:53:58 -0800
X-Trace: forums-1-dub 1299779638 10.22.241.152 (10 Mar 2011 09:53:58 -0800)
X-Original-Trace: 10 Mar 2011 09:53:58 -0800, vip152.sybase.com
Lines: 48
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8128
Article PK: 7150

Hello AK,

On 08/03/2011 9:59 AM, AK wrote:
> I have the following problem:
> - I have a field in a table with any text, but rtf formatted.
>
> Now i want execute a select command who I can see the clear text.

RTF format to plain text is not an easy conversion - particularly in
light of the many RTF formats that are now widely available (
http://en.wikipedia.org/wiki/Rich_Text_Format ).

---

To solve this problem, one would naturally be tempted to start looking
for a possible regular expression that could strip out the relevant
clear text information, and use the new regular expression features in
SQL Anywhere 11/12 to pull out the relevant information from the
database table (e.g. 'REGEXP_SUBSTR':
http://dcx.sybase.com/index.html#1201en/dbreference/regexp-substr-function.html
).

However, this is still a difficult problem (in general) to solve:

http://stackoverflow.com/questions/188545/regular-expression-for-extracting-text-from-an-rtf-string

---

Instead, you will likely need to build a conversion program of some type
- such as a Python script (see above), Perl script (possibly using
"RTF::TEXT" -
http://search.cpan.org/~sargie/RTF-Parser-1.09/lib/RTF/TEXT/Converter.pm
), or using some other language to 'properly' convert the values. You
can then use the external environments available in SQL Anywhere (
http://dcx.sybase.com/index.html#1201en/dbprogramming/pg-extenv.html )
in order to run these types of conversion scripts on your data.

Regards,

--
Jeff Albion, Sybase iAnywhere, an SAP Company

iAnywhere Developer Community :
http://www.sybase.com/developer/library/sql-anywhere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/