Re: csv export...?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andre, et al --

[Sorry for the delay...]

...and then Andre Speelmans said...
% 
% Hi David,

Hi!


% 
% On Fri, Jan 09, 2004 at 11:04:21AM -0500, David T-G wrote:
% > 
% >   header ("Content-Type: application/csv;") ;		# this is a CSV
% >   header ("Content-disposition: attachment; filename=authorized-visitors.$d.csv") ;	# file name
% >   ...
% >         [suck in file and dump into $a array]
% >         foreach ( array_keys($a) as $ak )		# walk thru the array
% >           { print "\"$a[$ak]\"," ; }			# print the field (yes, even if blank)
% 
% But this would go wrong if $a[$ak] contained a double quote. Remember you have

Oooh; good point.  My input is all sanitized, so " becoamse " and so
on, but for raw data that would definitely be a factor.


% to escape those characters. Can't the database of OP do a dump, like MySQL
% can?

Well, in my case each record is a file on disk, so that doesn't apply.


Thanks & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) davidtg@xxxxxxxxxxxxxxx * society and not sufficient moral courage.
(work) davidtgwork@xxxxxxxxxxxxxxx  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00093.pgp
Description: PGP signature


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux