[plug] database

Leon Brooks leon at brooks.smileys.net
Wed Sep 6 12:40:53 WST 2000


"Anthony J. Breeds-Taurima" wrote:
>> Uh, how hard is this? If Access will write anything like ASCII, it should be a
>> two-minute job.

> Yeah export each table a CSV, use the appropriate CREATE TABLE () and INSERT
> INTO statements.  then I have psql access to the data.   The slow down is the
> web/console interface that doen't mean I have to type long SQL statements.

sed <list.csv -e "s/'/''/g" | \
  gawk -F, \
  '{ print "INSERT INTO members VALUES('\"$1\"','\"$2\"','\"$3\"');\"; }" \
  >list.sql
psql plug <list.sql

-- 
Don't be nasty about our monarchy. That's our job. Get your own if
you want to be rude about them. -- Graham Cluley <sandspm at cix.co.uk>



More information about the plug mailing list