removing code blocks from autogenerated files with ant

I

ion

Help! I'm having a little difficulty doing this. I have an ant task
that generates a file. The file has errors. I have identified tokens in
the file that, when removed with the two previous and thirteen
subsequent lines, correct the error. So, I want to define something
like
grep -v -B2 -A13 %1 agfile.java > agfile.java
(1) grep -v doesn't work with -A and -B, at least not in Cygwin. So, I
can't remove these blocks with grep. How do I do it?
(2) Can I do variable substitution in ant?
<exec dir="${source}" executable="grep -A13 -B2 -v %1 agfile.java"
output="agfile.java">
<arg value="token 1"/>
</exec>
doesn't work.
(3) I have a number of these tokens, and I would like to pass them to
something as a list. Extract the block around one token, extract the
text around the following token. Does ant support this? Is there any
built in text manipulation in ant?
Thanks!
Ion
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top