EOL tag to ntext variable

  • Hello all,

    I have a question to you who are good at parsing text. I need to add row change with end of line tag to a ntext content. Basically the idea is that I could be able to extract a pre formatted text file from the ntext field.

    I've discovered the tag from a existing text file with substring function and I have the tag or chars saved in a table for future use. That is not the most beautiful way of doing it though.

    Any tips?

    Ilkka

  • Are you looking for something similar to this?

    select'Hello' + char(13) + char(10) + 'and goodbye'

    ------------------

    Hello

    and goodbye

    (1 row(s) affected)

    /Kenneth

  • Yeah that does the trick! Thanks. But I do not really understand what they do and what those char(10) and char(13) stand for? Is there more usable char(?) special tags and how can I find some descriptions on them?

    Ilkka

  • char 13 is a Carriage Return (vbCr) also known as

    char 10 is a Line Feed (vbLf) also known as \r (i think)

    in most PC based files, you'll find vbCrLf as the End of Line marker, however UNIX based files will only have vbLf;

    if you BULK INSERT from a unix file using the , you'll get wierd results, and need to change the rowterminator for the format.

    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!

  • Ilkka Vaahtoranta (10/8/2007)


    Yeah that does the trick! Thanks. But I do not really understand what they do and what those char(10) and char(13) stand for? Is there more usable char(?) special tags and how can I find some descriptions on them?

    Ilkka

    Probably this can help:

    http://www.asciitable.com/

    _____________
    Code for TallyGenerator

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

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