Date: Fri, 5 Dec 2008 11:31:46 +0100 From: Mel <fbsd.questions@rachie.is-a-geek.net> To: freebsd-questions@freebsd.org, mcoyles@horbury.wakefield.sch.uk Subject: Re: Mass find/replace... Message-ID: <200812051131.47577.fbsd.questions@rachie.is-a-geek.net> In-Reply-To: <005901c956c2$e90e4340$bb2ac9c0$@wakefield.sch.uk> References: <002b01c95609$ed0c7200$c7255600$@wakefield.sch.uk> <004e01c956c0$27f97820$77ec6860$@wakefield.sch.uk> <005901c956c2$e90e4340$bb2ac9c0$@wakefield.sch.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 05 December 2008 11:19:09 Marc Coyles wrote:
> > All done n' dusted now - thanks very much for everyone's input...!
> > Have noted everything down in the back of my copy of "Absolute
> > FreeBSD 2nd Edition" (which has inherited quite a few additional
> > pages since I bought it).
> >
> > Now that that's done, I can start to wander thru logs and find
> > who/how...
> >
> > Cheers!
> > Marc
>
> Arse - I spoke too soon.
>
> Anyone know any perl to remove blank lines???!
> It's left a blank line at top of each PHP file that it performed the action
> on, which has broken things a touch...
's/^(.*?)\r?\n\r?\n/$1\n/s' should only replace the first empty line it finds 
in a file and accounts for windows line endings.
Try it out on one file first:
perl -pi.bak 's/^(.*?)\r?\n\r?\n/$1\n/s' filename.php
-- 
Mel
Problem with today's modular software: they start with the modules
    and never get to the software part.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812051131.47577.fbsd.questions>
