Move portion of name from end to beginning
I have several filenames that are formatted like this: "title (year).ext"
I would like to move the (year) from the end of the filename to the beginning, so that they are then formatted as: "(year) title.ext"
What is the action and/or regular expression I need to use to do this?
I would like to move the (year) from the end of the filename to the beginning, so that they are then formatted as: "(year) title.ext"
What is the action and/or regular expression I need to use to do this?
Reply to #1:
Hello!
Based on what you've provided, this would work for you:
1) Create a "Replace Method"
2) For "Replace:" use:
^(.+?)\s+([0-9()]+)$
3) Replace with:
$2 $1
4) "Use regular expressions" -- checked
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
But exact details matter here:
Please provide a sample of actual filenames listing the "before" and the desired "after", *exactly*.
We need to know:
A) Is the date always at the exact end of the filename?
B) Is it always preceded by a space?
C) Are the parenthesis actually in the filename?
D) Possibly more depending on the *exact* circumstances.
Regards.
Randy
Hello!
Based on what you've provided, this would work for you:
1) Create a "Replace Method"
2) For "Replace:" use:
^(.+?)\s+([0-9()]+)$
3) Replace with:
$2 $1
4) "Use regular expressions" -- checked
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
But exact details matter here:
Please provide a sample of actual filenames listing the "before" and the desired "after", *exactly*.
We need to know:
A) Is the date always at the exact end of the filename?
B) Is it always preceded by a space?
C) Are the parenthesis actually in the filename?
D) Possibly more depending on the *exact* circumstances.
Regards.
Randy
Reply to #2:
Yes to all of your questions.
Your advice was exactly what I was looking for. Thank you.
Yes to all of your questions.
Your advice was exactly what I was looking for. Thank you.