Skip to content

Instantly share code, notes, and snippets.

@osima
Created November 2, 2010 05:40
Show Gist options
  • Select an option

  • Save osima/659288 to your computer and use it in GitHub Desktop.

Select an option

Save osima/659288 to your computer and use it in GitHub Desktop.
カレントディレクトリにある 文書名_hoge.eps をhoge.eps にコピーする.
//
// カレントディレクトリにある 文書名_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