CRLF

  • I have a field in my database

    150 Summer St#450

    It contains a CRLF after St and before #.

    I need to extract this data in 2 pieces.

    I need to select all the characters before the CRLF and all the

    characters after the CRLF.  Is there an easy way to do this?

  • Look into using the LEFT() and CHARINDEX() functions to search for the results of CHAR(13) which resolves to a new line.

    That should get you started.

  • I've removed CR-LF characters via an update statement like so:

    update

    MyTable set FieldA = replace(replace(FieldA, char(13), ''), char(10), '')

    where

    charindex(char(10), FieldA) > 0 or charindex(char(13), FieldA) > 0

Viewing 3 posts - 1 through 2 (of 2 total)

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