From owner-freebsd-questions@FreeBSD.ORG Sun Sep 6 20:40:07 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB36F1065670 for ; Sun, 6 Sep 2009 20:40:07 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 86D5A8FC0C for ; Sun, 6 Sep 2009 20:40:07 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MkOWq-0008Uo-1x for freebsd-questions@freebsd.org; Sun, 06 Sep 2009 22:40:04 +0200 Received: from 78-105-124-69.zone3.bethere.co.uk ([78.105.124.69]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 06 Sep 2009 22:40:04 +0200 Received: from cdr.nil by 78-105-124-69.zone3.bethere.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 06 Sep 2009 22:40:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Mark Willson Date: Sun, 06 Sep 2009 20:11:48 +0100 Lines: 40 Message-ID: References: <20090906003651.GA7388@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 78-105-124-69.zone3.bethere.co.uk User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <20090906003651.GA7388@thought.org> Sender: news Subject: Re: is there a way of usinf greo to find 3 or 4 blank lines? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2009 20:40:07 -0000 Gary Kline wrote: > in my manuscript, i have many places where i'ved used several > newlines to indicate a jump in time, or topic, or mood, or > <>. i have lost these vertical spacing in all but my > original draft. can i use grep somehow to find these extra newlines? > > > if not grep, then sed, ed, or what?! > > tia, > > gary > > > Gary, If I understand your question correctly (by no means certain), the following may help. This is an awk script, which will print out the lines in the source file at which it finds more than three consecutive empty lines. BEGIN { ncnt = 0 } /^ *$/ { ncnt++; if (ncnt > 3) {print "Emphasis at: " NR; ncnt = 0;} next; } {ncnt = 0;} You can invoke this (assuming the awk source in is a file called "em.awk" and your original manuscript is in a file called "manuscript") by: $ awk -f em.awk manuscript -mark