Reputation: 22670
E.g. to trim the first n characters of the lines, so that
123
1234
becomes
3
34
?
Upvotes: 0
Views: 713
Reputation: 5846
<target name="test">
<property name="trim_count" value="2"/>
<copy file="c:/test.txt" tofile="c:/test2.txt" overwrite="true">
<filterchain>
<tokenfilter>
<linetokenizer/>
<replaceregex pattern="^.{1,${trim_count}}(.*)" replace="\1"/>
</tokenfilter>
<ignoreblank/>
</filterchain>
</copy>
</target>
Upvotes: 2
Reputation: 643
I don't think Ant supports this type of functionality by default. Instead you'd have to use an external utility. If you share some specifics of the OS you are using, as well as what kind of characters or pattern that you are attempting to remove we might be able to further aid you.
Upvotes: 0