X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 470A8D1CAC7 for ; Tue, 16 Mar 2004 16:14:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 31171-05 for ; Tue, 16 Mar 2004 12:14:02 -0400 (AST) Received: from web20812.mail.yahoo.com (web20812.mail.yahoo.com [216.136.226.217]) by svr1.postgresql.org (Postfix) with SMTP id 8EE91D1C969 for ; Tue, 16 Mar 2004 12:14:00 -0400 (AST) Message-ID: <20040316161357.52404.qmail@web20812.mail.yahoo.com> Received: from [24.248.12.72] by web20812.mail.yahoo.com via HTTP; Tue, 16 Mar 2004 08:13:57 PST Date: Tue, 16 Mar 2004 08:13:57 -0800 (PST) From: Jeff Eckermann Subject: Re: Import from Ms Excel To: Andrew Sullivan , psql In-Reply-To: <20040316112930.GA4436@phlogiston.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/177 X-Sequence-Number: 17276 --- Andrew Sullivan wrote: > On Tue, Mar 16, 2004 at 03:13:38PM +0530, Kumar > wrote: > > Dear Friends, > > > > Is possible to import data from MS Excel sheet > into postgres > > database 7.3.4 running on Linux 7.2 > > Yes. I find the easiest way is to export a > delimited file from Excel > and use the \copy command in psql. A couple of quick points: * Don't use .csv, unless you are quite sure that your data does not include any commas. "Copy" isn't smart enough to know that the quotes mean "ignore the delimiters inside here". * If your data does include commas, even using tab-delimited will cause Excel to pointlessly quote those columns, and the quotes will be imported as data unless you remove them. * Make sure to remove any carriage returns that may have been included with your line endings. I think newer versions of "copy" are better about handling that, but best to be sure... > > A > > -- > Andrew Sullivan | ajs@crankycanuck.ca > I remember when computers were frustrating because > they *did* exactly what > you told them to. That actually seems sort of > quaint now. > --J.D. Baldwin > > ---------------------------(end of > broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com