pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Montervino, Mariano <montervi@cabal.com.ar>
To: Richard Huxton <dev@archonet.com>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: Especial delimiters caracter
Date: Wed, 24 Sep 2003 14:27:36 -0300
Message-ID: <9B9EF0AE4BCBD21190220008C74C77A903169B7C@NT-GROUPWARE> (raw)

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

-----Mensaje original-----
De: Richard Huxton [mailto:dev@archonet.com]
Enviado el: MiƩrcoles, 24 de Septiembre de 2003 14:19
Para: Montervino, Mariano; 'pgsql-sql@postgresql.org'
Asunto: Re: [SQL] Especial delimiters caracter


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



view thread (5+ messages)  latest in thread

Message-ID: <9B9EF0AE4BCBD21190220008C74C77A903169B7C@NT-GROUPWARE>
Permalink:  ../9B9EF0AE4BCBD21190220008C74C77A903169B7C@NT-GROUPWARE/
Also on:    postgresql.org/message-id/9B9EF0AE4BCBD21190220008C74C77A903169B7C@NT-GROUPWARE

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: montervi@cabal.com.ar, dev@archonet.com
  Subject: Re: Especial delimiters caracter
  In-Reply-To: <9B9EF0AE4BCBD21190220008C74C77A903169B7C@NT-GROUPWARE>
  References: <9B9EF0AE4BCBD21190220008C74C77A903169B7C@NT-GROUPWARE>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox