Skip to content

Instantly share code, notes, and snippets.

@kimukou
Forked from irof/replace.groovy
Created May 16, 2011 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimukou/973966 to your computer and use it in GitHub Desktop.
Save kimukou/973966 to your computer and use it in GitHub Desktop.
指定ディレクトリ配下のファイルの改行コードを変換する
new File("D:/work/hoge").eachFileRecurse(groovy.io.FileType.FILES) {
def s = "${it.readLines().join("\n")}\n"
it.withWriter("UTF-8"){ w->
w << s
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment