Scan
is used to scan files. It is basically the same than the
concat
ant task with the following modifications:
zipdata
element. Zipdata
is faster than zipfileset
because it does not scan the zip files twice (list content + parse).<taskdef name="scan" classname="net.sf.antcount.tasks.Scan" classpath="antcount.jar" />
Name | Description | Required | Default |
---|---|---|---|
encoding | Specifies the encoding for the input files. Please see http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html for a list of possible values. Defaults to the platform's default character encoding. | No | System encoding |
fixlastline | Specifies whether or not to check if each file concatenated is terminated by a new line. If this attribute is "true" a new line will be appended to the stream if the file did not end in a new line. | No | False |
eol | Specifies what the end of line character are for use by the
fixlastline attribute. Valid values for this property are:
|
No | Platform dependent. For Unix platforms, the default is "lf". For DOS based systems (including Windows), the default is "crlf". For Mac OS, the default is "cr". |
Scan
accepts the following nested elements.
verbose="true"
to print out which zip file and zip entry is currently being read.
<zipdata> <fileset dir="." includes="log*.zip" /> <patternset> <include name="myfolder/access*" /> </patternset> </zipdata>
Scan ${log.dir}/**/*.log and all access* in zip files ${log.dir}/**/log*.zip and count lines:
<scan> <fileset dir="${log.dir}" includes="**/*.log" /> <zipdata> <fileset dir="${log.dir}" includes="**/log*.zip" /> <patternset> <include name="access*" /> </patternset> </zipdata> <filterchain> <countfilter property="nb.lines" /> </filterchain> </scan>