Page 1 of 1

CSV - Sentences with comma's

Posted: Thu Oct 06, 2005 11:45 pm
by facets
Hi All,

I'm trying to export a CVS and have coem across a glitch.
The user has used comma's in a sentence and it has been saved into the DB.

When I export as CSV the comma triggers evrything after it to move one space left.
(Obviously how it should work!)

How would encapsulate the comma in the sentence and avoid excel/OOffice from using it?

Here's how i'm creating the code :

Code: Select all

echo "$colloPaperName,", "$paperCategory\n";
Tks, Will.

Posted: Fri Oct 07, 2005 12:05 am
by feyd
Place the sentance in quotes?

Posted: Fri Oct 07, 2005 12:11 am
by facets
So simple.
I was unaware that the quotes don't display in the csv.

Cheers!