Dos2Unix task

Converts newline characters of a file or a set of files from CRLF (DOS format) to CR (UNIX format). The conversion is done in binary so that it also works on files of different encoding.

This task forms an implicit fileset that supports all attributes of fileset as well as nested include, exclude and patternset elements.
Note: This task does not determine whether a file is binary before conversion. It is up to the user to exclude binary files from the conversion.

Parameters

The following table describes the parameters of the Dos2Unix task.

Attribute Description Required
file The file for which newline characters are converted. Exactly one of the two
dir The directory that contains the files for which newline characters are converted.
verbose Whether verbose mode should be enabled for this task. No; Defaults to false

Examples

The following example converts README.txt in the base directory to UNIX newline format.
<dos2unix file="README.txt" />
The following example converts all files of the HTML extension in the ${source.dir}/doc directory to UNIX newline format with verbose output.
<dos2unix dir="${source.dir}/doc" verbose="true">
    <include name="**/*.html" />
</dos2unix>