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 3A658D1B503 for ; Tue, 30 Sep 2003 11:43:29 +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 19697-02 for ; Tue, 30 Sep 2003 08:43:01 -0300 (ADT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by svr1.postgresql.org (Postfix) with SMTP id 5E1CFD1B4E3 for ; Tue, 30 Sep 2003 08:42:57 -0300 (ADT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Tue Sep 30 13:42:56 2003 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id NAA02635; Tue, 30 Sep 2003 13:42:56 +0200 (METDST) From: Christoph Haller Message-Id: <200309301142.NAA17746@rodos> Subject: Re: Especial delimiters caracter To: montervi@cabal.com.ar (Montervino, Mariano) Date: Tue, 30 Sep 2003 13:42:54 METDST Cc: pgsql-sql@postgresql.org In-Reply-To: <9B9EF0AE4BCBD21190220008C74C77A903169B7C@NT-GROUPWARE>; from "Montervino, Mariano" at Sep 29, 103 7:02 pm X-Mailer: Elm [revision: 212.4] X-Virus-Scanned: by amavisd-new at postgresql.org X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char 9C hex) in message header 'Received' Received: \234by rodos.fzk.de... ^ X-Archive-Number: 200309/422 X-Sequence-Number: 15400 > > Thanks for your replay... > I resolve the problem with sed before i post the question. > But a really want to know if i can handle all with posgre script. > > Mariano > No, you cannot. Because copy is also intended to work vice versa i.e. copy from file to table and therefore the doubled backslash is mandatory. Regards, Christoph > > 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 =3D 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=3Dtab. > You could also do this in sed: > $ sed -e 's/\\\\/\\/g' fakedump.txt > > HTH > --=20 > Richard Huxton