Fun! Will the number of files and lines in text file always match?
Personally because of my lack of experience I might look at writing a Python script that KM would call to do the renaming. I bet it can be done in KM as well but haven’t done that before.
So how much "control" do have over the inputs? Will the files be in a single directory -- and will there be other files/directories that shouldn't be renamed? Can you be sure that there will be the same number of lines in the text file as there will be files to rename? If everything's in the same directory, can you be sure that every line in the text file is unique?
File renaming isn't a destructive process, but it can be an absolute PITA to revert if it goes wrong part way through... Can you stand to duplicate the source directory, rename there, and delete the original after an eyeball? Or do we need to work in place and include things like uniq-ing the text file to check for duplicates, counts to make sure numbers match, and similar?
Coz the simplest method is to maintain a counter i and "For Each File in a Directory" rename to line i of text file then increment i. No safety net in that method though!
Total control of output, and it's simple flat file with an incrementing counter. File count and text count will absolutely match 1:1. Also, every line in text file will be unique (similar, but unique). For this particular process, I don't need a safety need for this process; they exist elsewhere in the workflow (if it went wrong, I have another version to go back to very quickly).
Apologies, I completely forgot to come back to this. I just needed to do this and thought "I'm sure I asked this question before" and sure enough, past-me did just that. Works perfectly