473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reading rtf from an image field

Hi,

Tasks in a MS Project SQL Server database have an image field called
TASK_RTF_NOTES. It contains text in RTF format. We would like to convert
this within a standard SQL statement into plain text.

I suspect this is not possible without some sort of bolt-on, or at the very
least using T-SQL in some way.

Any ideas?

Thanks,

Gareth

Jul 20 '05 #1
4 6967

"Gareth Thackeray" <fi****************@logicacmg.com> wrote in message
news:10***************@ernani.logica.co.uk...
Hi,

Tasks in a MS Project SQL Server database have an image field called
TASK_RTF_NOTES. It contains text in RTF format. We would like to convert
this within a standard SQL statement into plain text.

I suspect this is not possible without some sort of bolt-on, or at the very least using T-SQL in some way.

Any ideas?

Thanks,

Gareth


SQL is not a good language for text processing - a better approach would be
to use an external script or program to read out the RTF data, convert it,
then UPDATE the row with the new plain text data.

In theory, you might be able to write something in TSQL using REPLACE() to
remove all the RTF metadata strings, but it would be much easier to look for
an existing tool or piece of code in your preferred language (Perl, VB, C#
etc), then write a simple script to do this.

Simon
Jul 20 '05 #2
Gareth Thackeray (fi****************@logicacmg.com) writes:
Tasks in a MS Project SQL Server database have an image field called
TASK_RTF_NOTES. It contains text in RTF format. We would like to convert
this within a standard SQL statement into plain text.

I suspect this is not possible without some sort of bolt-on, or at the
very least using T-SQL in some way.


I don't know RTF very well, but from what I have seen of it, I certainly
would not try to extract the plain text using T-SQL. Sure, you can use
a screwdriver to drive a nail if you try real hard, but why?`

Possibly in the next version of SQL Server where you can call CLR directly
in SQL Server it could be worth trying.

But for now, do as Simon says and get the data to the client-side and
try something there. (For instance, open the document from Word as
RTF and save as plain text, using a Word-macto. Why reinvent wheels?)
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
"Erland Sommarskog" <es****@sommarskog.se> wrote in message
news:Xn**********************@127.0.0.1...
Gareth Thackeray (fi****************@logicacmg.com) writes:
Tasks in a MS Project SQL Server database have an image field called
TASK_RTF_NOTES. It contains text in RTF format. We would like to convert this within a standard SQL statement into plain text.

I suspect this is not possible without some sort of bolt-on, or at the
very least using T-SQL in some way.


I don't know RTF very well, but from what I have seen of it, I certainly
would not try to extract the plain text using T-SQL. Sure, you can use
a screwdriver to drive a nail if you try real hard, but why?`

Possibly in the next version of SQL Server where you can call CLR directly
in SQL Server it could be worth trying.

But for now, do as Simon says and get the data to the client-side and
try something there. (For instance, open the document from Word as
RTF and save as plain text, using a Word-macto. Why reinvent wheels?)


Thankyou both for your advice.

FYI, the reason for trying the route we are trying is that we are
integrating into Remedy ARS, and the built-in database integration only
allows views and tables to provide the data for a "View Form".

Furthermore, it is not permitted to add an image (or text...) field to the
form, so we would need to convert it at the SQL level.

I had thought it was probably a long shot but you don't get if you don't
ask..

Thanks again,

Gareth
Jul 20 '05 #4
Gareth Thackeray (fi****************@logicacmg.com) writes:
FYI, the reason for trying the route we are trying is that we are
integrating into Remedy ARS, and the built-in database integration only
allows views and tables to provide the data for a "View Form".

Furthermore, it is not permitted to add an image (or text...) field to the
form, so we would need to convert it at the SQL level.


You could have a separate job that reformats the RTF stuff into something
presentable. But if you cannot present text column in Remedy, you are pretty
lost anyway, unless you can accept to view the first 8000 chars only.

I have never heard of Remedy ARS, but I suppose there is a vendor. It may
be worth contact them and ask for suggestions.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and...
1
by: Cy | last post by:
I have a form that contains several browse fields for users to upload files. There is also a hidden field that is populated using javascript. This script reads the value of the browse field,...
0
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id of the picture (an integer) and one (column named picture) is a field of type OLE Object which...
1
by: Roberto Castro | last post by:
I have some problems with the way I am showing the BLOB fields in the Image web controls. It does work on my localhost though sometimes I need to hit Refresh for the images to load properly....
4
by: Andy | last post by:
Hello All: I have a field in the database that is an Image. I have no idea how the data is stored in here (Image, compressed, encrypted, plain text, etc). I am trying to write the contents to...
2
by: Chucker | last post by:
Hi Community, I think I can store Binary Data in SQL Server but when I try to retrieve it, I always only get one byte. I think I stored my Binary Data in SQL Server in a Colum of Type Image....
0
by: Tony Lugg | last post by:
I have an application with a document management form. When users add documents to the form, I call the API function SHGetFileInfo to get the associated large and small icons for the file. These...
3
by: Tony Lugg | last post by:
I have an application with a document management form. When users add documents to the form, I call the API function SHGetFileInfo to get the associated large and small icons for the file. These...
3
by: tom | last post by:
I'm trying to read in image data using the filesystemobject. I am able to read the comments field for all file types it seems, except the ones I want, .gif .jpg and .bmp. Is it possible to do...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.