Re: How would I get rid of trailing blank line?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How would I get rid of trailing blank line?
Date: 2009-04-03 02:53:37
Message-ID: dcc563d10904021953v53412679qdfdc8ba29589a098@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

On Thu, Apr 2, 2009 at 3:33 PM, Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu> wrote:
> Hi Everybody,
>
> I am using postgres 8.3.4 on linux.
> I often use a line like:
>   psql -tf query.sql mydatabase > query.out
>
> -t option gets rid of the heading and count
> report at the bottom.  There is a blank line
> at the bottom, however.  Is there any way to
> have psql not give me that blank line?

Tired of those blank lines in your text files? Grep them away:

psql -tf query.sql mydatabase | grep -v "^$" > query.out

>
> Thank you for your help.
>
> Regards,
>
> Tena Sakai
> tsakai(at)gallo(dot)ucsf(dot)edu
>

--
When fascism comes to America, it will be the intolerant selling it as
diversity.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2009-04-03 03:32:44 Re: More message encoding woes
Previous Message Robert Haas 2009-04-03 02:26:46 Re: benchmarking the query planner

Browse pgsql-sql by date

  From Date Subject
Next Message Tena Sakai 2009-04-03 05:52:09 Re: [HACKERS] How would I get rid of trailing blank line?
Previous Message Andrew Dunstan 2009-04-03 01:34:16 Re: [SQL] How would I get rid of trailing blank line?