Copy link to clipboard
Copied
Greetings,
Question is:
Is there a way to get around database information containing commas
when creating csv files?
I have the process down for creating a .csv file and storing to the server and
or e-mailing it out. The problem I have, is that one of the db fields being pulled
from the database has a comma in it and thus causes problems for me in
creating the csv file.
DB fields:
-- emp_number
-- emp_name (last_name, first_name)
-- activity_code
-- report_date
-- time_total
When the file is created it recognizes the comma in the emp_name field
and separates the last name and the first name and creates separate
columns for them in the csv file which do not match up with the db field
names in row 1 of the csv.
I have already searched the forum to see if this was asked before. Either
my eyes are too crossed from all the reading or i am not entering the
appropriate search criteria.
Any assistance will be greatly appreciated.
Leonard
double quote the data part.
Copy link to clipboard
Copied
double quote the data part.
Copy link to clipboard
Copied
Hi Dan,
Thanks for the response, that did the trick.
I was not aware of the double quote thing within csv files now I do.
Leonard
Copy link to clipboard
Copied
It might be an idea to familiarise yourself with the "spec" for CSV data:
http://en.wikipedia.org/wiki/Comma-separated_values#Basic_Rules
--
Adam
Copy link to clipboard
Copied
A Cameron,
Thanks for the link to the information that helped me understand better the
workings of csv files/creation of.
Leonard