Re: Commas in fields - Need to remove them or select without them

From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 07/07/04


Date: Wed, 7 Jul 2004 11:19:50 -0400

SELECT REPLACE(column, ',', '-') FROM table

-- 
http://www.aspfaq.com/
(Reverse address to reply.)
"Joseph Fessenden" <JosephFessenden@discussions.microsoft.com> wrote in
message news:750CF9B0-0AB8-4E1B-94BE-49E4CEF6D782@microsoft.com...
> I have a query that I need to run that gets BCPed into a CSV file.  The
problem is, if someone has entered a comma into the field, it ruins the BCP
file.  I need to know if anyone has a suggestion to do one of the following:
>
> 1 (preferred) - select the contents of the field either without the
comma(s) or replacing the commas with another character as part of a select
statement.
>
> 2 - update the contents of a table so that any commas (leading, trailing,
or embedded) are replaced with another character (e.g. "-").
>
> Thanks,
> Joe F.


Relevant Pages

  • Re: How to open a .CSV file ?
    ... character) could be escaped before any parsing took place. ... it wold split the string at whatever character it is told ... I assume when you said "parse at the comma" you meant string.split. ... it would be stupid to use it on a CSV file. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Forms to csv file
    ... Yes it will muck up your records in a CSV file especially if you use the comma as ... CSV = Comma Separated Values or is that Character Separated Values? ... > How do all of you handle free form data which may include ...
    (microsoft.public.frontpage.client)
  • Re: VB - Ascii to Unicode and then Unicode to UTF-8 conversion (Very desperate!!)
    ... Now I'm able to write Chinese characters to .CSV file. ... ..CSV file is Unicode file, I have problem with formatting part. ... AscW returns the real Unicode character ...
    (microsoft.public.vb.general.discussion)
  • Re: VB - Ascii to Unicode and then Unicode to UTF-8 conversion (Very desperate!!)
    ... Latin together) then you have to use a Unicode column type. ... AscW returns the real Unicode character ... for Chinese characters, ... then the next thing to worry about is your CSV file. ...
    (microsoft.public.vb.general.discussion)
  • Re: Newbie to MS Project - Need Help with Views
    ... Do not use the comma character as it is a reserved special character. ... >> The Owner field is not an available field in a Portfolio Analyzer>> view. ... >> in the OLAP cube for inclusion in your custom Portfolio Analyzer view. ...
    (microsoft.public.project)