could you read the file in with the properties first?
ie:
<copy file="manifest" tofile="manifest.copy"/>
<replace file="manifest.copy" token=":" value="="/>
<property file="manifest.copy">
<replace file="manifest" token="Implementation-version:
${implementation-version}" value="Implementation: ${new.version}"/>


d.

-----Original Message-----
From: Joylene Nettleton [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 24, 2003 11:22 AM
To: '[EMAIL PROTECTED]'
Subject: Replacing a string in a file


I have a manifest file looks like:
 
Manifest-Version: 1.0
Implementation-Vendor-Id: abc
Implementation-Vendor: xyz
implementation-version: def.4.0.1.0
Implementation-Title: something
Requires: config.anotherversion
 
I need to change the version number (the red part or 4.0.1.0 in this case)
based on another manifest file.  The part I need help is to replace the
"version number".  How do you replace the whole line in Ant with something
else?  Right now I could only get the 1st part, "implementation-version:
def." replaced by using the "replace" task.  The version number could be
anything.  I am just using 4.0.1.0 as example here.  I can not use any
function supported only in Perl or MKS tool kit because the file I am using
is shared with other users who may not have Perl/MKS tool kit installed on
their machine.  
 
Thanks for your help.
 
--Joylene
 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to