Created
November 2, 2010 05:40
-
-
Save osima/659288 to your computer and use it in GitHub Desktop.
カレントディレクトリにある 文書名_hoge.eps をhoge.eps にコピーする.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // カレントディレクトリにある 文書名_hoge.eps をhoge.eps にコピーする. | |
| // | |
| @Grab(group='commons-io', module='commons-io', version='1.4') | |
| import org.apache.commons.io.* | |
| new File('.').listFiles( { it.name.endsWith('.eps') } as FileFilter ).each{ | |
| //println it | |
| def basename = '文書名_' | |
| def newfilename = it.name.replaceAll( basename, '' ) | |
| def fin = new FileInputStream(it) | |
| def fout = new FileOutputStream(newfilename) | |
| CopyUtils.copy(fin, fout) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment