Re: importing data from Filemaker: weird newline characters

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: importing data from Filemaker: weird newline characters
Дата
Msg-id 20020121232117.GC3201@rice.edu
обсуждение исходный текст
Ответ на importing data from Filemaker: weird newline characters  (Frank Joerdens <frank@joerdens.de>)
Ответы Re: importing data from Filemaker: weird newline characters  (Frank Joerdens <frank@joerdens.de>)
Список 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 по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: support for transact-sql?
Следующее
От: David Stanaway
Дата:
Сообщение: Passing a list of pairs to a PL/PGSQL function