Re: importing data from Filemaker: weird newline characters - Mailing list pgsql-sql

From Ross J. Reedstrom
Subject Re: importing data from Filemaker: weird newline characters
Date
Msg-id 20020121232117.GC3201@rice.edu
Whole thread Raw
In response to importing data from Filemaker: weird newline characters  (Frank Joerdens <frank@joerdens.de>)
Responses Re: importing data from Filemaker: weird newline characters
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: support for transact-sql?
Next
From: David Stanaway
Date:
Subject: Passing a list of pairs to a PL/PGSQL function