how to Convert rtf format text from database ?

  • Hi Friends,

    In a table,there is a field(ntext) stored all the text in rich text format. I need to convert it back to normal text format. How can i do this ? I would be so happy if it is possible in script component in SSIS...

    Any help would be really appreciated.

  • I would find an existing rtf to txt batch convertor. You'll see several if you search for that phrase.

    So your process could possibly look lik.

    1) Export you field to a file using SSIS

    2) Call the batch convertor using a script to convert all your files

    3) Import the converted files back in

  • i've done this two different ways via a CLR; one that uses System.Forms, and another that calls a web service that does the same thing, basically;

    there are some regular expresisons out there that strips out most of the rtf tags(so you need a CLR for RTF), but i've had a few issues with them, so i prefer to stick with real objects that can manipulate RTF correctly.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Personally, I would find the person who stored such formatted data in the database and take them to the woodshed for a serious talk about what databases are.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Lowell (8/6/2013)


    i've done this two different ways via a CLR; one that uses System.Forms, and another that calls a web service that does the same thing, basically;

    there are some regular expresisons out there that strips out most of the rtf tags(so you need a CLR for RTF), but i've had a few issues with them, so i prefer to stick with real objects that can manipulate RTF correctly.

    Hi Lowell

    What do you mean by Real Objects ? Any third party tool? I don't have any knowledge about CLR..So I am sorry if i ask you meaning less questions...

  • Hi Lowell,

    After googling, i have learnt to open a new clr stored procedure project to convert rtf format. But as i told, i have no knowledge..So could you please guide me from here?

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply