X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9B295D1B511 for ; Wed, 24 Sep 2003 17:19:26 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 76744-07 for ; Wed, 24 Sep 2003 14:18:55 -0300 (ADT) Received: from anchor-post-37.mail.demon.net (anchor-post-37.mail.demon.net [194.217.242.87]) by svr1.postgresql.org (Postfix) with ESMTP id 3447FD1B546 for ; Wed, 24 Sep 2003 14:18:39 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-37.mail.demon.net with esmtp (Exim 3.35 #1) id 1A2DHj-000IbA-0b; Wed, 24 Sep 2003 18:18:39 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 64AF3162B1; Wed, 24 Sep 2003 18:18:38 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 9573315B96; Wed, 24 Sep 2003 18:18:37 +0100 (BST) From: Richard Huxton To: "Montervino, Mariano" , "'pgsql-sql@postgresql.org'" Subject: Re: Especial delimiters caracter Date: Wed, 24 Sep 2003 18:18:37 +0100 User-Agent: KMail/1.5 References: <9B9EF0AE4BCBD21190220008C74C77A903169B5F@NT-GROUPWARE> In-Reply-To: <9B9EF0AE4BCBD21190220008C74C77A903169B5F@NT-GROUPWARE> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309241818.37200.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/287 X-Sequence-Number: 15265 On Tuesday 23 September 2003 15:56, Montervino, Mariano wrote: > running the following script > > select ('cabal\\' || user_name) into temporary user_access from > tbl_user_access where access_profile_id = 4; > copy user_access to '/temp/users.txt' delimiters '|'; > > The result of the output file is... > domain\\users > but the field in the temp table is... > domain\users > > I need the same result like temp table. How could i do it?? > RGDS $ cat fakedump.txt C:\\Windows\\system32\\drivers|this\ttabbed\ttext\n $ perl -p -e 's/\\\\/\\/g;' fakedump.txt C:\Windows\system32\drivers|this\ttabbed\ttext\n As you can see, this only handles \\ not \t=tab. You could also do this in sed: $ sed -e 's/\\\\/\\/g' fakedump.txt HTH -- Richard Huxton Archonet Ltd