pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ross J. Reedstrom <reedstrm@rice.edu>
To: Frank Joerdens <frank@joerdens.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: importing data from Filemaker: weird newline characters
Date: Mon, 21 Jan 2002 17:21:17 -0600
Message-ID: <20020121232117.GC3201@rice.edu> (raw)
In-Reply-To: <20020121174103.A5050@superfly.archi-me-des.de>
References: <20020121174103.A5050@superfly.archi-me-des.de>

On Mon, Jan 21, 2002 at 05:41:03PM +0100, Frank Joerdens wrote:
> After importing a table from Filemaker 5.5 (via COPY from a csv file),
> I've got newline characters from text fields in the original Filemaker
> db which appear as ^K, or control-K on the console in psql or vi. I am
> wondering how to deal with those. How do I find out what it is? Are
> there standards as to how to represent newlines etc. in text fields in
> SQL databases?

Low, many suns ago, I also imported some text from Filemaker: that's how
FM exports newlines. Postgresql can handle newlines in it's data, by
quoting them with '\'. So a sed run on the CSV file with something like:

sed 's/^K/\\^M' <old.csv >new.csv

Where the ^K and ^M are actual control codes (generated in bash with 
^I^K and ^I^M) should do it.

Ross




view thread (5+ messages)  latest in thread

Message-ID: <20020121232117.GC3201@rice.edu>
Permalink:  ../20020121232117.GC3201@rice.edu/
Also on:    postgresql.org/message-id/20020121232117.GC3201@rice.edu

 · 

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: reedstrm@rice.edu, frank@joerdens.de
  Subject: Re: importing data from Filemaker: weird newline characters
  In-Reply-To: <20020121232117.GC3201@rice.edu>

* 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