[tpm] Exporting Access files to .csv

Shlomi Fish shlomif at shlomifish.org
Mon Oct 15 06:21:38 PDT 2012


Hi Chris,

On Mon, 15 Oct 2012 09:07:39 -0400
Chris Jones <cj at enersave.ca> wrote:

> Thank you.
> 
> I have written a perl script using DBI ADO.  The 
> select and print statements work.  I am using the 
> join statement to separate the fields by ',' but 
> I can't figure out a way to get the text fields 
> quoted so the output resembles the CSV output by msaccess.
> 
> Example output from access:
> 240,10,"SPACE:LGT-W/A[1]","if( Local( ZONE-TYPE ) 
> == 1 then 1 endif","Set lighting power","8.4.4.6","db 2012-04-19 -
> added",1,0
> 
> The field types:
> number, number, text, memo, text, text, memo, integer, integer.
> 
> The output from my script:
> 
> 240,10,SPACE:LGT-W/A[1],if( Local( ZONE-TYPE ) == 
> 1 then 1 endif,Set lighting power,8.4.4.6,db 2012-04-19 - added,1,0
> 
> Thanks for any insight!

Please use https://metacpan.org/module/Text::CSV to output CSV (as well
as read it). Read its documentation for configurations options that control
the resultant output.

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
My Aphorisms - http://www.shlomifish.org/humour.html

“My only boss is God. And Chuck Norris who is his boss.”

Please reply to list if it's a mailing list post - http://shlom.in/reply .


More information about the toronto-pm mailing list