473,837 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7017

"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****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
"Erland Sommarskog" <es****@sommars kog.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****@sommarsk og.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
7103
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 disadvantages of using a MySQL blob field rather than reading the images directly from the file? How does one insert an image into a blob field? Can it be done dynamically? Thank you John
1
1942
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, splits the string and returns the name of the file to the hidden field. This is done so the file name can be re-used. My problem is that the javascript appears to be unable to read the browse field in order to send the file name to the hidden...
0
1622
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 contains an image (it can store jpg, bmp, gif, but I don't know what image is stored inside). I want to retrieve the picture stored in the database and identified by a given id and display it in a web page (.aspx). I write in Visual C#, but it does...
1
3305
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. However, when I try to access the same page from another machine or when I test the code on a remote server the images just wouldn't show. The page I am talking about has 3 Image web controls. In the CodeBehind I am loading these controls by using an...
4
7627
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 a text file, image file, etc so I can see if the data is stored in a way we can understand (we have been tasked to write an app and the app needs to read this field, but we don't know what it really contains). How would I go about reading the...
2
3759
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. At least when I execute the following code, I get some significant network traffic. When I check the database with query analyzer, I see 4 Hex Chars in the image colum. Like 0xe0 etc.
0
1501
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 icons are added to two ImageList objects which are bound to a ListView control, and everything looks great. I am saving the icons to a SQL Server table by using Icon.Save to a stream and assigning the byte array to the field, then loading them...
3
2762
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 icons are added to two ImageList objects which are bound to a ListView control, and everything looks great. I am saving the icons to a SQL Server table by using Icon.Save to a stream and assigning the byte array to the field, then loading them...
3
3340
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 this?! If so what might I need to do? Thanks! here is the script im using to loop through each possible sub field:
0
9830
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10562
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10263
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6989
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5842
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4469
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4036
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3122
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.