Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jul 2008 22:23:09 -0700
From:      Walt Pawley <walt@wump.org>
To:        Gary Kline <kline@thought.org>, FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG>
Subject:   Re: How to divide up?
Message-ID:  <p062408b5c4a87bc6df50@[10.0.0.10]>
In-Reply-To: <20080720002345.GA9173@thought.org>
References:  <20080720002345.GA9173@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
At 5:23 PM -0700 7/19/08, Gary Kline wrote:
>Guys,
>
>Is there an easyy way of splitting yp these tags into one-per-line?
>I'm not obcessive [[?, :)]], but for what I've got in mind, the tags and stuff
>would look better to my eyes?  ....the outcome of this will go ino a special
>database, not html .
>
>is there some clever perl one-liner that would help me turn
>
><CENTER><FONT face="Times" size="3"><FONT color="#333366">Realization<BR>
>
>into
>
><CENTER>
><FONT face="Times" size="3">
><FONT color="#333366">
>Realization
><BR>

I've been using this ...

#!/usr/bin/perl
# Process HTML data on STDIN into one tag per line form on STDOUT
while (<>) {
	s/\r/\n/gs;
	s/</\n</gs;
	s/>/>\n/gs;
	s/\n\s*/\n/gs;
	s/^\s*//;
	print "$_"
}

... for quite some time under the name "tag1". It's come in very handy.
-- 

Walter M. Pawley <walt@wump.org>
Wump Research & Company
676 River Bend Road, Roseburg, OR 97470
         541-672-8975



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p062408b5c4a87bc6df50>