Remove Character From String

  • I've inherited a 'lovely' misformatted csv file with about 3million+ rows which I need to import into SQL to use.

    Using the Import/Export wizard, I can import everything fine if I set it to recognizing no text delimiters. (If I try and set the delimiter to double quotes, it errors out after about a million rows...).

    The thing is, then I have all these extraneous quotes on every string.

    ie, I've got "ABCDE" when I want ABCDE

    Is there a quick way to rid myself of all these extra quotes? As a reference, the quotes don't appear anywhere in the strings I'm trying to get at.

    I guess what I'm really looking for is a good find/replace... But notepad doesn't have 'replace' and Excel would freak out if I tried to get it to open a file with 3 million rows.

    So I'm left with coping with it in SQL.

    Hopefully someone's got some insight on this?

    Thanks!

  • how about

    update mytable

    set myfield = replace(myfield, '"','')

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Perfect - Thanks!

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

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