需要ant脚本才能从文件中删除重复的行
- >不管用
<copy file="${logfile}" tofile="C:/workspace/oracletest/servers.txt" overwrite="yes" >
<filterchain>
<tokenfilter delimoutput="\n">
<containsregex pattern="(JB|ws)" flags="i"/>
<stringtokenizer/>
<!--<uniqfilter/>-->
</tokenfilter>
</filterchain>
</copy>
</target>
答案 0 :(得分:3)
doc似乎暗示,你必须在uniqfilter之前使用sortfilter:
<filterchain>
<tokenfilter delimoutput="\n">
<containsregex pattern="(JB|ws)" flags="i"/>
<stringtokenizer/>
</tokenfilter>
<sortfilter />
<uniqfilter/>
</filterchain>