How do I do unix2dos (or dos2unix) with ant. I.e. I want to change the newlines from linux newlines (if any) to dos newlines
Asked
Active
Viewed 7,486 times
2 Answers
21
Found - it is the Ant FixCRLF task.
![](../../users/profiles/183172.webp)
martin clayton
- 72,583
- 29
- 209
- 194
![](../../users/profiles/63051.webp)
flybywire
- 232,954
- 184
- 384
- 491
-
1Wow! It's the first time I can actually say "Jon Skeet saved my week!" :) – sinuhepop Jul 26 '12 at 10:21
-
Guess, who else got their day saved (ik its 2020) :D – powersource97 Sep 28 '20 at 13:44
4
You can use the built-in fixcrlf
ant task on a set of files instead of using dos2unix
.
The following example is equal to running dos2unix
on all *.sql
files located under the "SQL" directory:
<fixcrlf srcdir="${SQL}" includes="**/*.sql" eol="lf" eof="remove" />
see for more details.
![](../../users/profiles/363573.webp)
Stephan
- 37,597
- 55
- 216
- 310
![](../../users/profiles/1826023.webp)
Michael G.
- 1
- 1