ant_renamer
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| ant_renamer [2026/01/24 12:20] – created smickster | ant_renamer [2026/01/24 13:11] (current) – [Regular Expressions for Renaming] smickster | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| You can use regular expressions. This is helpful but there' | You can use regular expressions. This is helpful but there' | ||
| - | Let's say each of your file names are song titles but they are all lower case. Song titles as you might imagine will often be first letter upper case. " | + | One example that didn't work was trying to capitalize the first letter of each word. So just note that this fLet's say each of your file names are song titles but they are all lower case. Song titles as you might imagine will often be first letter upper case. " |
| + | |||
| + | Another is: \([^)]*\) which finds text inside parentheses and removes all that. So if a file name was: 01 Chali 2na - Get Focused (Live) then it would remove (Live) from the file. That's helpful because it's common in audio files and often redundant or not useful. | ||
| + | |||
| + | Sidenote, powershell can do some of this. And A.I. can help with powershell. | ||
| + | |||
| + | check out this script: | ||
| + | |||
| + | < | ||
| + | Get-ChildItem -File | ForEach-Object { | ||
| + | $base = [System.IO.Path]:: | ||
| + | $ext = $_.Extension | ||
| + | $title = (Get-Culture).TextInfo.ToTitleCase($base.ToLower()) | ||
| + | Rename-Item -LiteralPath $_.FullName -NewName ($title + $ext) | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | Regarding the above code, you can shift+right-click in a directory, run powershell there and copy that script into powershell and it will rename those files so each lowercase word in the file will have uppercase first letter. | ||
| + | |||
| + | |||
ant_renamer.1769257223.txt.gz · Last modified: by smickster
