sdasdas

1541 ワード

def units = new File("C:\\all")

def humUnits = ['footman','gryphonrider','knight','peasant','priest','rifleman','seigeengine','sorceress','spellbreaker','summonwaterelemental','dragonhawk','flyingmachine','mortarteam']
def orcUnit = ['wyvernrider','demolisher','grunt','headhunter','kotobeast','peon','raider','shaman','spiritwalker','spiritwolf','tauren','trollbatrider','witchdoctor']
def neUnits = ['mountaingiant','wisp','archer','chimaera','druidoftheclaw','druidofthetalon','dryad','faeriedragon','glaivethrower','hippogriff','huntress']
def udUnits = ['shade','abomination','acolyte','banshee','cryptfiend','frostwyrm','gargoyle','ghoul','meatwagon','necromancer','obsidianstatue','destroyer']

def unitName = humUnits + orcUnit + neUnits + udUnits

units.listFiles().each{
def un = it.name.replaceAll("BTN","").replaceAll(".jpg","").toLowerCase()
if(unitName.indexOf(un) != -1){
println "renaming ${it.name}"
it.renameTo(new File("c:\\all2\\${un}.jpg"))
}
}
""