Re: AWK script

Поиск
Список
Период
Сортировка
От Andrej
Тема Re: AWK script
Дата
Msg-id l2vb35603931004131230t5cfb5bfdp83233d7ceaff7091@mail.gmail.com
обсуждение исходный текст
Ответ на Re: AWK script  (Atif Jung <atifjung@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Sean Davis
Дата:
Сообщение: Re: Getting started
Следующее
От: "Danny Lo"
Дата:
Сообщение: How to best partition table