I have a folder of over 6,000 Excel files that I need renamed (perfect for automation, huh?). All of these files currently have random names. For example, one of them is named “000e8d53-86e0-4fb3-a3e8-7453c95b2601.xlsx.” I need to somehow get these files renamed and restructured.
I’d like to be able to rename them based on content INSIDE the excel file. All of the files are the same format, and include data like a date, product number, and customer name. Is there a way to write a script (or maybe use Hazel) to look inside the excel documents, grab the data, and then rename the file?
I know that you would be able to use Python (using openpyxl) or Perl (using Spreadsheet::Read) to do this. I don’t know the file format of Excel well enough, nor which languages you feel comfortable with, to be able to recommend a general solution.
I know you could also be able to do this with AppleScript, but my (ancient) experience tells me that might be a headache.
How did you do it in the end? What was your approach? I am eager to learn.
Right now the first thing which comes to my mind is to use Hazels match patterns… that should work.
I actually ended up doing it on windows (though it pained me to do so).
There is a tool called WinAutomation. It is a lot like Keyboard Maestro, but has the ability to grab data out of excel documents. They have a nice free trial, so I was able to do it all without paying anything.