ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jürgen Hauser <hau...@pandora.be>
Subject RE: Remove blank lines
Date Thu, 19 Feb 2004 10:56:36 GMT
Thanks for replying. But it doesn't seem to work as expected. Either way, i 
will solve it otherwise, i will execute a script which will take care of it 
(all it takes is one line of code).

Thanks again!

At 00:28 19.02.2004, you wrote:
>I think that the following should do the trick:
>
>             <replaceregexp flags="g" byline="false">
>                 <regexp pattern="\r\n[\s]*\r\n[\s]*\r\n"/>
>                   <substitution expression="&#13;&#10;&#13;&#10;"/>
>                   <fileset dir="${dist}">
>                         <filename name="**/*.php"/>
>                   </fileset>
>             </replaceregexp>
>
>Where "\r\n[\s]*\r\n[\s]*\r\n" means 2 blank lines and
>"&#13;&#10;&#13;&#10;" means 1 blank line, so the maximum of blank lines
>will be 1.
>
>
>
>-----Original Message-----
>From: Jürgen Hauser [mailto:hauser@pandora.be]
>Sent: miércoles, 18 de febrero de 2004 20:35
>To: user@ant.apache.org
>Subject: Remove blank lines
>
>Hi,
>
>I'm having troubles finding out how to actually remove blank lines.
>
>I have a regular expression which will match all blank lines, but since
>it
>needs to be replaced with something, you get the problem ;)
>
>             <replaceregexp flags="g" byline="true">
>                 <regexp pattern="^[\s]*$"/>
>                   <substitution expression=""/>
>                   <fileset dir="${dist}">
>                         <filename name="**/*.php"/>
>                   </fileset>
>             </replaceregexp>
>
>To be honest, what i would really like to achieve is to have it remove
>blank lines only if there are two or more blanklines in a row, so it
>still
>leaves one blank line.
>
>ie.
>
>1. $foo = 'bar';
>2. blank line
>3. blank line
>4. $user =& new User();
>5. blank line
>6. $user->doSomething();
>
>would result in
>
>1. $foo = 'bar';
>2. blank line
>3. $user =& new User();
>4. blank line
>5. $user->doSomething();
>
>Thanks a lot in advance!
>
>Regards,
>Jürgen
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message