Remove commas

G

garethhop22

I have a large database (17k records plus) which gets converted to csv format
to send to head office, some people puts commas in the various fields, this
alters the csv and cause a mass migrane for me the morning after, is there a
sql statement or like to run before converting to strip the records of these
rogue characters (and others if possible)?
 
G

Gman

How are you creating the CSV files? Users putting commas in text fields
is (normally) perfectly acceptable behaviour.

Normally CSV files can be created to format text fields with quotes thus:
Name1, "text with commas, and other punctuation", Other Data1
Name2, text without commas, Other Data2
This prevents confusion by the importing application.

Another option is to use different delimiters e.g. pipe, tab etc. for
you file.

If you *really* want to remove commas from text fields you could remove
it in SQL e.g.

SELECT REPLACE(AddressLine1,',',''), REPLACE(AddressLine2,',','')
FROM tblAddresses
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top