Rename Files to Modified Time with Perl

We were processing hundreds of recordings for a client, but they didn’t know the dates on the files because moving between systems changed the date time stamp. The solution was to programatically rename the files with their modified time so no matter where the file went, we would always know it’s date.

This is just a snippet that we wanted to save and thought you might find it useful.

What to Learn From this Perl Script

  • Get an Array of Files
  • Loop over and Array
  • Extra Modified Time from Files using Stat
  • Rebuild File names Based on our Desire
  • Rename Files, Programmatically

Perl Source Code to Rename Files with Dates

Custom Perl Programming

Do you have problems that you want solved by automation or scripting? Contact us for custom Perl programming. We can write small and large scripts for system administration, or every day tasks such as renaming files.

Leave a Reply

Your email address will not be published. Required fields are marked *