Received: from ece.rice.edu (ece.rice.edu [128.42.4.34]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0LNLIl71026 for ; Mon, 21 Jan 2002 18:21:18 -0500 (EST) (envelope-from reedstrm@rice.edu) Received: from localhost (localhost [127.0.0.1]) by ece.rice.edu (Postfix) with ESMTP id 4933868A57; Mon, 21 Jan 2002 17:21:19 -0600 (CST) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by ece.rice.edu (Postfix) with ESMTP id 3C00168A1D; Mon, 21 Jan 2002 17:21:18 -0600 (CST) Received: from reedstrm by wallace.ece.rice.edu with local (Exim 3.22 #1 (Debian)) id 16Snkb-0000rN-00; Mon, 21 Jan 2002 17:21:17 -0600 Date: Mon, 21 Jan 2002 17:21:17 -0600 From: "Ross J. Reedstrom" To: Frank Joerdens Cc: pgsql-sql@postgresql.org Subject: Re: importing data from Filemaker: weird newline characters Message-ID: <20020121232117.GC3201@rice.edu> Mail-Followup-To: "Ross J. Reedstrom" , Frank Joerdens , pgsql-sql@postgresql.org References: <20020121174103.A5050@superfly.archi-me-des.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020121174103.A5050@superfly.archi-me-des.de> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS snapshot-20010714 X-Archive-Number: 200201/249 X-Sequence-Number: 6333 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' new.csv Where the ^K and ^M are actual control codes (generated in bash with ^I^K and ^I^M) should do it. Ross