Skip site navigation (1) Skip section navigation (2)

Re: Especial delimiters caracter

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Montervino, Mariano" <montervi(at)cabal(dot)com(dot)ar>,"'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Especial delimiters caracter
Date: 2003-09-24 17:18:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
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??

$ cat fakedump.txt
$ perl -p -e 's/\\\\/\\/g;' fakedump.txt

As you can see, this only handles \\ not \t=tab.
You could also do this in sed:
$ sed -e 's/\\\\/\\/g' fakedump.txt

  Richard Huxton
  Archonet Ltd

In response to

pgsql-sql by date

Next:From: Tomasz MyrtaDate: 2003-09-24 17:23:44
Subject: Re: Useful SQL-statement?
Previous:From: Bruce MomjianDate: 2003-09-24 16:12:26
Subject: Re: Datafiles for Databases

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group