Date: Tue, 28 Sep 2004 12:53:12 +0200 From: Fabian Keil <freebsd-listen@fabiankeil.de> To: freebsd-questions@freebsd.org Cc: Gary Kline <kline@tao.thought.org> Subject: Re: regex replacement wizard advice needed Message-ID: <200409281253.12887.freebsd-listen@fabiankeil.de> In-Reply-To: <20040927192859.GA82254@thought.org> References: <20040927192859.GA82254@thought.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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/<B>NNN/</B><BR>/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: > > <B>1</B><BR> > Paragraph1. > <B>2</B><BR> > Paragraph2. > ... > <B>29</B><BR> > Paragraph29. > ... > <B>747</B><BR> > Paragraph747. I'd rather take something like: (echo "<html><head><title>Title</title></head><body><h1>Title</h1><ol>"; perl -n -e 's@^\d+\s+(.*$)@<li><p>$1</p></li>@;print' input.txt; echo "</ol></body></html>") >output.html Without the line breaks, of course. Semantic markup and valid HTML 2.0. Regards Fabian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409281253.12887.freebsd-listen>