On Wed, 15 Jan 2003 08:46:04 +1100, [EMAIL PROTECTED]
(Colin Johnstone) wrote:

>Is a CSV a comma delimited list. If so when creating a CSV how does one cope with 
>fields that have commas in them. 
>
>An address filed for example could be written suite 2, lvl 3.
>
>Do you write the field names out with quotes around them?

Flak-jacket on!

A simple way around this is to use something like chr(1) for your
separator, instead of a comma. Then your only problem is to
filter all fields to exclude chr(1). chr(1) is non-printable, so when
you look at your csv files, you will see a funny symbol in place of
it. On my system, it's a diamond.

Just run all new data thru this regex:
$fielddata =~ s/chr(1)//g;
and that prevents a hacker from messing up your data.

I've been chastised before for mentioning this, because it is 
"non-standard"; but it works for me, and is simple.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to