ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suettenbach, Roger" <Roger.Suettenb...@Dresdner-Bank.com>
Subject How to deal with multi lines in the <replace> task?
Date Fri, 10 Jan 2003 11:24:36 GMT
Hi everybody,

I would like to replace two lines by only one line in a file, for example,
change a file "notes.txt" with the following contents

first line
second line
third line
fourth line

to the contents

first line
second and third line
fourth line

I tried the <replace> task with

<replace file="notes.txt" value ="second and third line" >
          <replacetoken><![CDATA[second line 
third line]]></replacetoken> 
</replace>

and I also tried

<replace file="notes.txt" value ="second and third line" >
          <replacetoken><![CDATA[second line ${line.separator} third
line]]></replacetoken> 
</replace>


but nothing worked.  Any idea what I did wrong? I can imagine that the
specification of the line separator is not correct or that the declaration
of the token must be different.

Thanks in advance!

Regards,
Roger




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


Mime
View raw message