ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jürgen Hauser <hau...@pandora.be>
Subject Remove blank lines
Date Wed, 18 Feb 2004 19:35:25 GMT
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


Mime
View raw message