Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008
    Posts
    24

    Unanswered: Need to replace embedded newline characters in a column

    Hello,

    I have a table in which a column has embedded newline (ascii 10) characters.
    I need to replace the newline characters with something else - something distinct yet not a line break.

    Does anyone have any idea how to do such a replace/update?

    Thanks in advance,

    chasse

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    use str_replace
    Code:
    select str_replace('this is line 1
    and line 2',char(10),' - ')

  3. #3
    Join Date
    Aug 2008
    Posts
    24
    Brilliant!
    Thank you. I was not familiar with that function.

  4. #4
    Join Date
    Mar 2007
    Posts
    86

    use unix regex cmd

    Quote Originally Posted by chassemerrill
    Hello,

    I have a table in which a column has embedded newline (ascii 10) characters.
    I need to replace the newline characters with something else - something distinct yet not a line break.

    Does anyone have any idea how to do such a replace/update?

    Thanks in advance,

    chasse
    this strips the ^M off the eol
    tr -d '\015' <file_in >file-out

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •