Re: AWK script

From: Andrej <andrej(dot)groups(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: AWK script
Date: 2010-04-13 19:30:46
Message-ID: l2vb35603931004131230t5cfb5bfdp83233d7ceaff7091@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 14 April 2010 02:41, Atif Jung <atifjung(at)gmail(dot)com> wrote:
> Sorry Glenn, I should have made it clear, when I said 'var[x,y]' is
> completely variable I meant the whole string, so it could look like:
>
> var[x,y]
> :h_def[x,y]
> hello[x,y]
>
> and so on ....

echo "var[x,y]
:h_def[x,y]
hello[x,y]" | sed -r 's|^([^[]+)\[([^,]+),([^]]+)\]|\1 FROM \2 FOR \3|'
var FROM x FOR y
:h_def FROM x FOR y
hello FROM x FOR y

Does that help?

Cheers,
Andrej

--
Please don't top post, and don't use HTML e-Mail :} Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Danny Lo 2010-04-14 01:10:24 How to best partition table
Previous Message Sean Davis 2010-04-13 17:07:56 Re: Getting started