I have about 200,000 records (rtf formatted text) in sql server databse that I have to convert to either html or plain text. I have been searching for some instructions for the last couple of days but can't find anything. One article mentioned that using
RichText control is a possible solution but no further mention was provided.
I have tried using regex, search and replace and various forms of sql, none of which are viable solutions. I am at my wits end. There has got to be a way to do this. Do you have any suggestions?
I don't think there is a sql command for that. You have to retrieve each of the items from the database and then re-save it. You should be able to write a .net application that retrieves the item, runs the formatting code, and saves it back in the database.
saburius
Member
139 Points
249 Posts
How to convert rtf to plain text - remove rtf formatting
Jan 03, 2013 10:05 PM|LINK
Hi,
I have about 200,000 records (rtf formatted text) in sql server databse that I have to convert to either html or plain text. I have been searching for some instructions for the last couple of days but can't find anything. One article mentioned that using RichText control is a possible solution but no further mention was provided.
I have tried using regex, search and replace and various forms of sql, none of which are viable solutions. I am at my wits end. There has got to be a way to do this. Do you have any suggestions?
Thank you!
kevinstone
Member
236 Points
48 Posts
Re: How to convert rtf to plain text - remove rtf formatting
Jan 03, 2013 10:11 PM|LINK
check it here
http://www.codeproject.com/Articles/11309/Converting-RTF-to-TXT-format
saburius
Member
139 Points
249 Posts
Re: How to convert rtf to plain text - remove rtf formatting
Jan 03, 2013 11:00 PM|LINK
I have data i the database, not files on the file system...
shahed.kazi
All-Star
17955 Points
3636 Posts
Re: How to convert rtf to plain text - remove rtf formatting
Jan 03, 2013 11:33 PM|LINK
I don't think there is a sql command for that. You have to retrieve each of the items from the database and then re-save it. You should be able to write a .net application that retrieves the item, runs the formatting code, and saves it back in the database.
.NET World |Captcha Control
oned_gk
All-Star
35872 Points
7330 Posts
Re: How to convert rtf to plain text - remove rtf formatting
Jan 04, 2013 01:34 AM|LINK
How to: Convert RTF to Plain Text (C# Programming Guide)
http://msdn.microsoft.com/en-us/library/vstudio/cc488002.aspx
Suwandi - Non Graduate Programmer