Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

csv file creation - output contains comma - work around?

Engaged ,
Feb 23, 2010 Feb 23, 2010

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

548
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 23, 2010 Feb 23, 2010

double quote the data part.

Translate
LEGEND ,
Feb 23, 2010 Feb 23, 2010

double quote the data part.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2010 Feb 23, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2010 Feb 23, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2010 Feb 23, 2010
LATEST

A Cameron,

Thanks for the link to the information that helped me understand better the

workings of csv files/creation of.

Leonard

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources