From owner-freebsd-questions@FreeBSD.ORG Mon Sep 7 07:07:03 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 CFA12106566B for ; Mon, 7 Sep 2009 07:07:03 +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 89ED58FC0A for ; Mon, 7 Sep 2009 07:07:03 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MkYJZ-0000cs-GK for freebsd-questions@freebsd.org; Mon, 07 Sep 2009 09:07:01 +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 ; Mon, 07 Sep 2009 09:07:01 +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 ; Mon, 07 Sep 2009 09:07:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Mark Willson Date: Mon, 07 Sep 2009 08:06:51 +0100 Lines: 34 Message-ID: References: <20090906003651.GA7388@thought.org> <20090906232300.GA11209@thought.org> <20090907010602.GA11657@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: <20090907010602.GA11657@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: Mon, 07 Sep 2009 07:07:03 -0000 Gary Kline wrote: >> Yes, this works just fine. I findthat there are about 130 places that I need to >> track... --yeah, i did over-do it in the time-breaks in my story. >> >> Is there a way of printing the string/line in the `manuscript' file along with the line >> number? I'm well into a copyedit of the manuscript and would rather not start over! >> >> thanks for this. >> > :wq > > Sorry:: sounds a bit moronic:: not print the blank line/newline! but print the > NR-1-th line. Gary, The following version should do what you want: BEGIN { ncnt = 0 prev = "BOF" } /^ *$/ { ncnt++; if (ncnt > 3) { print "Emphasis at " NR ": " prev; prev = "-multiple-" ncnt = 0; } next; } {ncnt = 0; prev = $0} -mark