Scan is used to scan files. It is basically the same than the concat ant task with the following modifications:


Using taskdef:
<taskdef name="scan"
         classpath="antcount.jar" />


Name Description Required Default
encoding Specifies the encoding for the input files. Please see 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:
  • cr: a single CR
  • lf: a single LF
  • crlf: the pair CRLF
  • mac: a single CR
  • unix: a single LF
  • dos: the pair CRLF
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".

Nested Elements

Scan accepts the following nested elements.


Files to be scanned. See the fileset documentation in the ant manual.


This element represents zipped data to be read. These data are zip entries in one or several zip files. Zip files are selected using nested filesets and zip entries are selected using nested patternsets.
For example, the following will select all files named myfolder/access* in zip files named log*.zip:
You can use the attribute verbose="true" to print out which zip file and zip entry is currently being read.
	<fileset dir="." includes="log*.zip" />
		<include name="myfolder/access*" />


Filters to apply. See the filterchain documentation in the ant manual.


Scan ${log.dir}/**/*.log and all access* in zip files ${log.dir}/**/log*.zip and count lines:

	<fileset dir="${log.dir}" includes="**/*.log" />
		<fileset dir="${log.dir}" includes="**/log*.zip" />
			<include name="access*" />
		<countfilter property="nb.lines" />