Jump to content

Can you rename multiple files from a spreadsheet list?


Recommended Posts

I'm brand new to Alfred. Here is my task.

 

I need to rename over 5000 files (phone prompts). I have the files in sequential order in a folder. The list of unique names is in a spreadsheet column. Can a workflow be written to select the top name in the spreadsheet, copy, select the top file in the finder window, paste, go back to spreadsheet and select next name, copy, select next file in finder window, paste, etc.?

 

If Alfred can't do it, do you have a suggestion for what can?

Link to comment

Thanks for your reply. I am producing files in sessions for different departments. Yes I can make a cvs file of each list of file names. The first list has 577 file names. I will have to do this for several groups.

 

I'm not a programmer and don't know how to write shell scripts.

Link to comment

I'm not a programmer and don't know how to write shell scripts.

Yes, I was expecting as much. I meant that just as a small hint that the problem wasn’t being approached the best way, as Alfred would be way too complex for this, if it’s something needed only once. I’m offering to help with the script.

Could you please export one of those as .csv and make it available for download? You can alter characters and words to make the data fake: the thing I need is to understand its structure (how many columns on the spreadsheet, if numbers are separated from words, what’s the column to target, if there are commas in the date itself).

Link to comment

A .csv is what I need. You should be the one to create it, to make sure they’ll always be made the same way. What I’m saying is the file you link to appears to not be a .csv, but a binary instead.
 

I then saved it as a .csv file and removed all data except column A.

 
You can change the data, but don’t remove anything or else the structure will be different. I need something close to the files you’ll be working on, to make it work.

Link to comment

There you go, and a video on how to use it.

I ended up using the simplest .csv (the other one was displaying weirdly). To format them correctly, delete everything that isn’t a name (including the FILE NAME line you had). If the number of lines in the .csv and the number of files in the directory differ, it’ll throw an error and stop. You should also know the Finder and terminal are different regarding alphabetical order; while the Finder shows

1
2
3
4
5
6
7
8
9
10
11

the terminal shows

1
10
11
2
3
4
5
6
7
8
9

so keep that in mind if your files are sequential.

Link to comment

Vitor,

 

Thanks for your efforts.

 

When I drop the script onto Terminal I get a message telling me it won't open because I don't have appropriate access privileges. However, my Get Info box tell me I have "read and write" privileges. What's with that.

Link to comment

You don’t need to drop it on the terminal; double-clicking should be fine. As for permissions, type in a terminal chmod +x (notice there’s a space at the end, so it should be something like chmod +x /path/to/renamer.command) and press . That’ll give execute permissions.

Link to comment
Guest
This topic is now closed to further replies.
×
×
  • Create New...