Re: Processing data from table using awk.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: John McKown <john(dot)archie(dot)mckown(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Processing data from table using awk.
Date: 2015-10-06 14:22:38
Message-ID: CAKFQuwZhQaOzwrRuPgmyDJ2jGAEGjLg=Vj1kJSJcf7RybgQLfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 6, 2015 at 10:15 AM, Melvin Davidson <melvin6925(at)gmail(dot)com>
wrote:

> Your best bet is something like
>
> #!/bin/bash
>
> get_data ()
> {
> QRY=$(psql $HOST $PORT $USER $DBNAME <<_QUERY_
>
> \o your_output_file
> SELECT col1, col2, ...., coln
> FROM your_table
> WHERE <blah>;
>
> _QUERY_
>
> )
> }
>
> awk <blah> your_table
>
>
​I presume you mean "awk <blah> your_output_file" ...

David J.​

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Reid Thompson 2015-10-06 14:25:01 Re: Processing data from table using awk.
Previous Message David G. Johnston 2015-10-06 14:20:43 Re: Processing data from table using awk.