I have several folders with 10 files in it. Their names are specific to their content.
I have another set of folders with files of the same content but at a higher resolution (video files) and similar names - same at the beginning but with additional characters at the end.
I want to rename the second set of file to the same names as the first set of files but don.t want to manually copy and paste a bizillion times.
So something like this:
folderA/
file 1xxx
file 2xxx
file 3xxx
folderB/
file 1
file 2
file 3
Becomes this:
folderB/
file 1xxx
file 2xxx
file 3xxx
and so on. So the "file 1" part remains the same but "xxx" is matched to to the correct file and added on to the name.
I'm pretty sure I can do it in bash, but wondering if someone (<clearing throat> JLittle ) knows a short cut or special trick I don't know.
More specifically, the first 23 characters of the two file sets' names are the same. The "xxx" part on the first set is of varying length and there are spaces in both sets of file names.
The full file names look like:
"Series name - s01e01 - Episode Name.mp4"
and the target files look like:
"Series name - s01e01 - .mp4"
So I want to match the first 23 characters, then rename the file to the full name.
I could totally do this easily in postgresql but my bash-foo is not so strong...
I have another set of folders with files of the same content but at a higher resolution (video files) and similar names - same at the beginning but with additional characters at the end.
I want to rename the second set of file to the same names as the first set of files but don.t want to manually copy and paste a bizillion times.
So something like this:
folderA/
file 1xxx
file 2xxx
file 3xxx
folderB/
file 1
file 2
file 3
Becomes this:
folderB/
file 1xxx
file 2xxx
file 3xxx
and so on. So the "file 1" part remains the same but "xxx" is matched to to the correct file and added on to the name.
I'm pretty sure I can do it in bash, but wondering if someone (<clearing throat> JLittle ) knows a short cut or special trick I don't know.
More specifically, the first 23 characters of the two file sets' names are the same. The "xxx" part on the first set is of varying length and there are spaces in both sets of file names.
The full file names look like:
"Series name - s01e01 - Episode Name.mp4"
and the target files look like:
"Series name - s01e01 - .mp4"
So I want to match the first 23 characters, then rename the file to the full name.
I could totally do this easily in postgresql but my bash-foo is not so strong...
Comment