import java.io.File; import java.util.*; import java.io.IOException; class Renamer { public static void main(String[] args) throws Exception { String path = "."; String files; File folder = new File(path); File[] listOfFiles = folder.listFiles(); for (File f: listOfFiles) { f.renameTo(new File(f.getName().replaceAll("_mdpi",""))); } } }
Using Textpad's ctrl+1 and ctrl+2 shortcuts for run and compile, the task becomes easy., but I'm sure that using one liners in other script proggies are faster. I need get around to learning Python or something. Hmmmm....
No comments:
Post a Comment