ls -1 | sed "s/\(.*\).step2.xml1/move & \1.xml/" | cmd - for batch renaming files. Refer this.

Installing a toolkit with Unix utilities is a must (until PowerShell Monad is available). I recommend this and this. If you use the sourceforge one, the advantage is that the commands are a direct port - much faster. Standard approach is to just dump all these files into a Utils folder which is in your computer PATH. Then all your "cmd" shell windows will support these commands. "grep", "sed" are really useful from this bundle.


 

January 6, 2006
@ 01:49 PM

When you use replaceAll in Java, you cannot use a "$" or a "\" in the replacement String.

It throws a java.lang.IndexOutOfBoundsException: No group XX exception. The solution is here. The "$" and the "\" in the replacement string have to be delimited before being sent in to the Regex parser.