ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "momo momo" <molbia...@hotmail.com>
Subject Replacing but not thwhole file
Date Tue, 06 Jan 2004 10:26:22 GMT
Hi all,

I want to replace in a file "#project" by "project" but not in the whole 
file. Only from the begining to the string "# end part1". Is that possible 
to do it with the task replace or replaceregexp?

I want to make exmaple2.txt from example.txt, part2 stay the same.
example.txt:
#begin part1
#project.key1=1
#project.key2=A
#end part1

#begin part2
#project.key3=Z
project.key3=W
#end part2


example2.txt:
#begin part1
project.key1=1
project.key2=A
#end part1

#begin part2
#project.key3=Z
project.key3=W
#end part2

I tried some codes:
	<replaceregexp file="example.txt"
		match="#(project.*# end : config liée à l'environnement.*)"
		replace="\1"
		flags="gs"
	/>

but I didn't succeed!
I allways get all changes or one change...

Does anyone have an idea?
Thanks to help me

_________________________________________________________________
Trouvez l'âme soeur sur MSN Rencontres http://g.msn.fr/FR1000/9551


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


Mime
View raw message