Last active
August 29, 2015 14:06
-
-
Save dgroft/504b93f88834573bfb44 to your computer and use it in GitHub Desktop.
Rename multiple files in a directory using Regex.
This file contains 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
# rename multiple files in a directory using regex | |
# source: http://stackoverflow.com/questions/5574648/use-regex-powershell-to-rename-files | |
ls | %{ ren $_ $($_.name -replace '(TestFile_\w+)(\d+)(\.txt)', '${1}20140910${3}')} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment