Skip to content

Instantly share code, notes, and snippets.

@irof
Forked from kyonmm/replace.groovy
Created May 16, 2011 04:24
Show Gist options
  • Save irof/973938 to your computer and use it in GitHub Desktop.
Save irof/973938 to your computer and use it in GitHub Desktop.
指定ディレクトリ配下のファイルの改行コードを変換する
new File("src").eachFileRecurse(groovy.io.FileType.FILES) {
def s = it.text.replaceAll(/\r\n?/,'\n')
it.withWriter("UTF-8") {it << s}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment