| From: | Ennio-Sr <nasr(dot)laili(at)tin(dot)it> |
|---|---|
| To: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: Colors/bold chars in a select? |
| Date: | 2006-04-20 20:40:40 |
| Message-ID: | 20060420204040.GA6460@deby.ei.hnet |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
* Andrew Chambers <andychambers2002(at)yahoo(dot)co(dot)uk> [150406, 12:31]:
> * Ennio-Sr <nasr(dot)laili(at)tin(dot)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) ]
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ketema Harris | 2006-04-20 21:16:54 | Constraining future rows based on past rows |
| Previous Message | Frances Collier | 2006-04-20 15:47:36 | Re: postgresql connection problems |