Created
December 15, 2024 11:44
-
-
Save kmwalsh/5eea5458f9f7ea95a7194ca87513b296 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## powershell - remove everything in a filename up to the first dash | |
## useful when emoji are named 392394-something-something.png | |
foreach ($file in (get-childitem *.png).name) { | |
Rename-Item $file ($file -replace '^[^-]*-\s*') | |
} | |
## powershell - transform underscores to dashes | |
Get-ChildItem *.png | Rename-Item -NewName { $_.Name -replace '_','-' } | |
## CMD - prefix all files in a folder with a given prefix | |
for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "PREFIX_HERE-%f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment