For the PC owners: Have you ever used Windows PowerShell? It's something akin to Command Prompt, and can be utilized for task automation. It provides a really easy way to batch rename hundreds of files in a folder. Specifically, I had hundreds of individual file names containing a "-" that needed to be replaced or removed, and I was looking for something straightforward for changing the names. I found Windows PowerShell, which is a management framework that was developed about ten years ago. I discovered it was pretty easy to use PowerShell for this task and others like it, and thought I'd share it here! Here's how to get set up: All your files should be in one folder, which you'll designate as your working directory. Open PowerShell on your PC. You can just type "powershell" into the search box in Windows 10. A window will open. To navigate to your folder of files, type "cd" (change directory) at the prompt and then add a space. Drag and drop your working folder into the PowerShell window. The drag and drop puts the whole file path into place for you. Press enter and you'll see that you're now operating out of your folder. to do a batch rename on the files in your current directory:
How does it work? You are 'piping' ("|") the contents of your directory ("dir") to the "rename-item" cmdlet (read: command-lette). If you were to enter only "dir" at the prompt, you would see all the files in your folder displayed; we use the last section of the script to run through all of these files. I initially learned of this command at: https://www.howtogeek.com/111859/how-to-batch-rename-files-in-windows-4-ways-to-rename-multiple-files/
0 Comments
|
PhyloBlogCovering topics of phylogenetics and systematics & other science-related news. Archives
October 2019
Categories
All
|