From: | "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu> |
---|---|
To: | Frank Joerdens <frank(at)joerdens(dot)de> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: importing data from Filemaker: weird newline characters |
Date: | 2002-01-21 23:21:17 |
Message-ID: | 20020121232117.GC3201@rice.edu |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | David Stanaway | 2002-01-22 00:39:16 | Passing a list of pairs to a PL/PGSQL function |
Previous Message | Stephan Szabo | 2002-01-21 21:01:59 | Re: support for transact-sql? |