Tuesday, September 15, 2015

windows - Batch rename of several files




We have several files with filenames similar to below:


Organizing_your_day_in_acute_care_-_Flash_(Medium)_-_20120516_12.04.02PM.mp4
Developing_a_Business_Plan_-_IT_Projects_-_Flash_(Medium)_-_20120529_09.39.09PM.mp4
GI_Medications_-_Flash_(Medium)_-_20120607_11.35.50AM.mp4
Effectiveness_and_Data_and_Information_Set_-_Flash_(Large)_-_20120208_02.41.28PM.mp4
Adult_Learning_-_Theory_-_Flash_(Medium)_-_20100519_05.25.02PM.mp4

What I'd like to do is create a batch script to rename these files so that all the underscores are removed and everything after the "_-_Flash" string is removed, essentially leaving the files as so:


Organizing your day in acute care.mp4
Developing a Business Plan - IT Projects.mp4
GI Medications.mp4
Effectiveness and Data and Information Set.mp4
Adult Learning - Theory.mp4

Any help would be greatly appreciated.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...