[EMAIL PROTECTED] wrote: >> Unfortunately I can't use line number count to find the insertion >> position in the first file. I have a certain string in this file >> which is my marker where the insertion should occur. > > > > Maybe <replaceregexp> could do the job. > http://ant.apache.org/manual/OptionalTasks/> replaceregexp.html > > > Something like > > <loadfile > property="text" srcFile="insertedText"/> <replaceregexp > file="theFile" match="(.*)(textafterthis)(.*)" > replace="\1\2$text\3" > />
Or alternatively (although less flexible) a combination of loadfile, filter and copy? <loadfile property="text" srcFile="insertedText"/> <filter token="textToReplace" value="${text}"/> <copy file="theFile" toFile="targetFile" filtering="true"/> (Notice that the marker needs to be @textToReplace@ in the above example.) Regards, Ilja --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]