Re: Colors/bold chars in a select? - Mailing list pgsql-novice

From Ennio-Sr
Subject Re: Colors/bold chars in a select?
Date
Msg-id 20060420204040.GA6460@deby.ei.hnet
Whole thread Raw
In response to Re: Colors/bold chars in a select?  (Andrew Chambers <andychambers2002@yahoo.co.uk>)
Responses Re: Colors/bold chars in a select?  (Andrew Chambers <andychambers2002@yahoo.co.uk>)
List pgsql-novice
* Andrew Chambers <andychambers2002@yahoo.co.uk> [150406, 12:31]:
> * Ennio-Sr <nasr.laili@tin.it> [2006-04-14 23:27:38 +0200]:

> .....

> This task sounds like a job for awk.  The syntax of the script below
> might not be quite correct but you should be able to do something
> like...
>
> psql -f query.sql |awk ' { if($2 >= $1) print "\e[32;01m" $0
>                            else print $0
>                          } '
>
Hi Andrew,
thank you for your suggestion: I wouldn't expect it was possible to pipe the psql
command output and was looking for a psql command ...

Unfortunately, awk does the job perfectly in a test table (having
only a few output fields) whereas it seems to get confused when I use it
for the real table and with multiple conditions ( if .. do; else if ..
do ; else do ). I'm reading man awk just now ... ;)

Best regards,
    Ennio.

--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!"  (diceva Henry Miller) ]    (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that.              )=(
 Do something you aren't good at!" (as Henry Miller used to say) ]

pgsql-novice by date:

Previous
From: "Frances Collier"
Date:
Subject: Re: postgresql connection problems
Next
From: Ketema Harris
Date:
Subject: Constraining future rows based on past rows