You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by momo momo <mo...@hotmail.com> on 2003/12/16 16:57:38 UTC

replacing commented text

Hi all,
I would like to extract a piece of my  property file:

##################################################
#environnement A
##################################################
#Jdbc
#project.jdbc.datasource=datasource1
[...]
#End of environnement A

##################################################
#environnement B
##################################################
#Jdbc
project.jdbc.datasource=datasource2
[...]
#End of environnement B


and copy it in another file to have that:

##################################################
#environnement A
##################################################
#Jdbc
project.jdbc.datasource=datasource1
[...]
#End of environnement A

I don't know what is exatly in the sample, the only thing I know is the 
first 3 lines and the last line.
I tried to catch the text sample that interest me by using copy and 
filterchain

<copy file="${src}" tofile="${dest}">
	<filterchain>
		<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
			<param type="regexp" value="??????????????"/>
		</filterreader>
	</filterchain>
</copy>

but I didn't succeed!
Is that possible to take a piece of text and copy it in a file?
any help will be appreciate.

Momo

_________________________________________________________________
Hotmail : un compte GRATUIT qui vous suit partout et tout le temps ! 
http://g.msn.fr/FR1000/9493


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