需要Ant示例才能从文件中删除重复的行。 <uniqfilter>无法正常工作</uniqfilter>

时间:2012-07-10 11:58:26

标签: ant

需要ant脚本才能从文件中删除重复的行         - &GT;不管用                               
                                                  

        <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> 

1 个答案:

答案 0 :(得分:3)

doc似乎暗示,你必须在uniqfilter之前使用sortfilter:

   <filterchain>
       <tokenfilter delimoutput="\n">
                <containsregex pattern="(JB|ws)" flags="i"/>
             <stringtokenizer/> 
       </tokenfilter>
       <sortfilter />
       <uniqfilter/>
    </filterchain>