Re: Processing data from table using awk. - Mailing list pgsql-general

From David G. Johnston
Subject Re: Processing data from table using awk.
Date
Msg-id CAKFQuwZhQaOzwrRuPgmyDJ2jGAEGjLg=Vj1kJSJcf7RybgQLfw@mail.gmail.com
Whole thread Raw
In response to Re: Processing data from table using awk.  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
On Tue, Oct 6, 2015 at 10:15 AM, Melvin Davidson <melvin6925@gmail.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.​
 

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Processing data from table using awk.
Next
From: Reid Thompson
Date:
Subject: Re: Processing data from table using awk.