pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Clayton Cottingham <drfrog@smartt.com>
To: Martin Neumann <lists@mne.de>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re:
Date: Thu, 02 Sep 1999 09:59:47 +0000
Message-ID: <37CE4A90.9831D625@smartt.com> (raw)
References: <m11MPyy-000DMVC@darwin.oche.de>

martin:
couple o things:

use something like sed to pre process the file taking out the erronous
data, if you know what the bad data is

one thing i use sed for is html escape single quotes and the like,

it should work well for you

the regex for substituting like  that is:
s/old/new/g

the sed command operates regexes with an -e switch :

 sed -e s/error/correction/g errorfile>correctedfile
takes errorfile in and changes any occurence of 'error' to 'correction'
and
prints all data to correctedfile


also if its a flat file you could just use the copy command in psql
instead of inserts:

\copy tablein from filename





view thread (4+ messages)

Message-ID: <37CE4A90.9831D625@smartt.com>
Permalink:  ../37CE4A90.9831D625@smartt.com/
Also on:    postgresql.org/message-id/37CE4A90.9831D625@smartt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: drfrog@smartt.com, lists@mne.de
  Subject: Re:
  In-Reply-To: <37CE4A90.9831D625@smartt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox