Re: AWK script - Mailing list pgsql-novice

From Andrej
Subject Re: AWK script
Date
Msg-id l2vb35603931004131230t5cfb5bfdp83233d7ceaff7091@mail.gmail.com
Whole thread Raw
In response to Re: AWK script  (Atif Jung <atifjung@gmail.com>)
List pgsql-novice
On 14 April 2010 02:41, Atif Jung <atifjung@gmail.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

pgsql-novice by date:

Previous
From: Sean Davis
Date:
Subject: Re: Getting started
Next
From: "Danny Lo"
Date:
Subject: How to best partition table