From owner-freebsd-questions@FreeBSD.ORG Sun Sep 6 20:44:13 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 EC65C1065676 for ; Sun, 6 Sep 2009 20:44:13 +0000 (UTC) (envelope-from mak@kolybabi.com) Received: from mail.nepharia.org (mail.nepharia.org [209.44.104.71]) by mx1.freebsd.org (Postfix) with ESMTP id C5DD08FC15 for ; Sun, 6 Sep 2009 20:44:13 +0000 (UTC) Received: from brisbane.nepharia.org (wnpgmb0807w-ad02-161-57-125.dynamic.mts.net [207.161.57.125]) by mail.nepharia.org (Postfix) with ESMTPSA id 349CD3E8D53; Sun, 6 Sep 2009 15:44:12 -0500 (CDT) Received: by brisbane.nepharia.org (nbSMTP-1.00) for uid 1000 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) mak@kolybabi.com; Sun, 6 Sep 2009 15:44:14 -0500 (CDT) Date: Sun, 6 Sep 2009 15:44:13 -0500 From: Mak Kolybabi To: Gary Kline Message-ID: <20090906204412.GA28721@brisbane.nepharia.org> References: <20090906003651.GA7388@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20090906003651.GA7388@thought.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-questions@freebsd.org 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:44:14 -0000 On 2009-09-05 17:36, 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?! Sed has the ability to pull into the current line the next line, appended and separated by a "\n" character. It's hard to use correctly, I've found, and my simple demo: sed -e '/^$/{N;N;N; s/^\n\n\n$/===4 blank lines==/; }' Does not quite work as I'd hoped. But hopefully it's enough to get you started. -- Matthew Anthony Kolybabi (Mak) () ASCII Ribbon Campaign | Against HTML e-mail /\ www.asciiribbon.org | Against proprietary extensions