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

AWK script

From: Atif Jung <atifjung(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: AWK script
Date: 2010-04-13 13:30:29
Message-ID: i2ud1c6b9c51004130630o7ff6aca9wc5c3724d82c40553@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
I've been tasked with writing a script which will automatically update our
exisitng INFORMIX code to include POSTGRES compliant equivalent code. My awk
skills are pretty basic to say the least, but  I've managed to write some of
the rules in an awk script, but am having difficulty with the following


*CHANGE* *INFORMIX CODE*

ORDER BY var[x,y];

*TO POSTGRES CODE*

ORDER BY SUBSTRING(var FROM x FOR y);

my problem is var[x,y] is completely variable. How do I check for that in
AWK/SED? Is it even possible?

Thanks

Responses

pgsql-novice by date

Next:From: glennDate: 2010-04-13 14:02:24
Subject: Re: AWK script
Previous:From: Jasen BettsDate: 2010-04-13 12:58:42
Subject: Re: Partitioning for query performance

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