Re: html to postgres... - Mailing list pgsql-general

From Vince Vielhaber
Subject Re: html to postgres...
Date
Msg-id Pine.BSF.4.30.0107161137330.23283-100000@paprika.michvhf.com
Whole thread Raw
In response to html to postgres...  (Tony Grant <tony@animaproductions.com>)
List pgsql-general
On 16 Jul 2001, Tony Grant wrote:

> Hello,
>
> I have several hundred HTML (!) pages that need to be converted to a
> format that in turn can be imported into PostgreSQL. They are all built
> on a very similar grid.
>
> Any thoughts?

For the integrated docs I wrote a C program (I suck at perl) and a
shell script to send to stdout:

\connect whateverdatabaseyouwant
insert into table(pagereference,textofpage) values('titleofpage','

The parse the file and send it to stdout but take any apostrophes and
backslashes and escape them.  Then follow it up with:

');\n

and when run it took a directory of about 480 files and neatly filed
them into a table.

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




pgsql-general by date:

Previous
From: "Thalis A. Kalfigopoulos"
Date:
Subject: Re: PASSWORD() function for postgresql?
Next
From: "Mitch Vincent"
Date:
Subject: Re: html to postgres...