From owner-freebsd-questions@FreeBSD.ORG Tue Sep 28 10:53:41 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0CFB416A4CE for ; Tue, 28 Sep 2004 10:53:41 +0000 (GMT) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [62.67.200.157]) by mx1.FreeBSD.org (Postfix) with ESMTP id 248FC43D1F for ; Tue, 28 Sep 2004 10:53:40 +0000 (GMT) (envelope-from freebsd-listen@fabiankeil.de) Received: (qmail 7401 invoked from network); 28 Sep 2004 10:53:38 -0000 Received: from unknown (HELO [192.168.2.48]) ([pbs]775067@[213.54.10.233]) (envelope-sender ) by smtprelay02.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 28 Sep 2004 10:53:38 -0000 From: Fabian Keil To: freebsd-questions@freebsd.org Date: Tue, 28 Sep 2004 12:53:12 +0200 User-Agent: KMail/1.7 References: <20040927192859.GA82254@thought.org> In-Reply-To: <20040927192859.GA82254@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409281253.12887.freebsd-listen@fabiankeil.de> cc: Gary Kline Subject: Re: regex replacement wizard advice needed X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2004 10:53:41 -0000 On Monday 27 September 2004 21:28, Gary Kline wrote: > I have a document with numbered paragraphs, the numbers > to the far left of each paragraph. Is there a perl > s/NNN/NNN/
/g means I can use from the CL or > as a script to make this doc more easy (for me) to read. > > The document is formatted like this: > > 1 Paragraph1. > 2 Paragraph2. > ... > 29 Paragraph29. > ... > 747 Paragraph747. > > > I would like it to be like this: > > 1
> Paragraph1. > 2
> Paragraph2. > ... > 29
> Paragraph29. > ... > 747
> Paragraph747. I'd rather take something like: (echo "Title

Title

    "; perl -n -e 's@^\d+\s+(.*$)@
  1. $1

  2. @;print' input.txt; echo "
") >output.html Without the line breaks, of course. Semantic markup and valid HTML 2.0. Regards Fabian