From owner-freebsd-questions@FreeBSD.ORG Sun Jul 20 02:03:29 2008 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 2CC0E106567D for ; Sun, 20 Jul 2008 02:03:29 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id F039F8FC2E for ; Sun, 20 Jul 2008 02:03:27 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl133-207.kln.forthnet.gr [77.49.252.207]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-4) with ESMTP id m6K23GjJ005632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 20 Jul 2008 05:03:22 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id m6K23Gr0004058; Sun, 20 Jul 2008 05:03:16 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id m6K23Fiq004057; Sun, 20 Jul 2008 05:03:15 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Gary Kline References: <20080720002345.GA9173@thought.org> <878wvxfkq0.fsf@kobe.laptop> Date: Sun, 20 Jul 2008 05:03:15 +0300 In-Reply-To: <878wvxfkq0.fsf@kobe.laptop> (Giorgos Keramidas's message of "Sun, 20 Jul 2008 03:44:07 +0300") Message-ID: <87mykde2ho.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: m6K23GjJ005632 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.789, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.61, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: FreeBSD Mailing List Subject: Re: How to divide up? 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, 20 Jul 2008 02:03:29 -0000 On Sun, 20 Jul 2008 03:44:07 +0300, Giorgos Keramidas wrote: > Now, if you want to merely "hack something quick and dirty", a short > Perl script can probably do regexp substitution similar to > > # > # WARNING: THIS HAS NOT BEEN TESTED :P > # > my $foo = ; > $foo = s:(<[^>]+>[^<]*]+>):$1\n:ge; > print "$foo"; > > but you shouldn't trust the output of such a quick hack too much. As I wrote in reply to the personal email, this was untested and a bit wrong in places, but now I've tried something like: $ echo 'worldnext world' | \ perl -e '$foo = ; $foo =~ s:(<[^>]+>[^<]*]+>):$1\n:g; print "$foo";' and it does seem to sort of work. The output is: world next world Maybe that's good enough? They say `the perfect is the enemy of good enough', so if this works for your data set, it's probably ok to use it :-) Have fun, Giorgos