Re: How can I erase these blank lines

From: Charles Demas (demas_at_TheWorld.com)
Date: 03/30/04


Date: Tue, 30 Mar 2004 18:00:55 +0000 (UTC)

In article <c4c9s5$667$1@unlnews.unl.edu>,
Han JIANG <jianghanunl@yahoo.com> wrote:
>Hi,
>I am a newbie on unix. I met a strange problem here on Origin 2000.
>
>I created a text data file which had 1,000 lines on my pc (Windows of
>course) and upload it to my acoount on Origin.When I use vi to edit it on
>Origin, I found there is a additional blank line between every 2 lines!
>That makes my program cann't input this datafile.
>
>Who know what happen here? And how can erase these additional blank lines?
>Please don't say erase them line by line since I have 1000 lines there.

awk 'NF>0' infile > outfile

or more cryptically:

awk 'NF' infile > outfile

Chuck Demas

-- 
  Eat Healthy        |   _ _   | Nothing would be done at all,
  Stay Fit           |   @ @   | If a man waited to do it so well,
  Die Anyway         |    v    | That no one could find fault with it.
  demas@theworld.com |  \___/  | http://world.std.com/~cpd


Relevant Pages