Page 1 of 1

Rename cropping end of file name

PostPosted: Sun Apr 28, 2019 4:25 am
by Tromac
Hi,

I have a Synology NAS that has had an issue with syncing files to a cloud service. End result is that I have a large number of image files (years of my photography) that have been renamed to the format below. The problem is that there is also the original file name there though that appears corrupted. So I need to rename and overwrite the original file names.

Example:

Original file 3O3A1645.CR2
New file 3O3A1645_DiskStation_Feb-17-0231-2019_Conflict.CR2

The only commonality in the names across the various folders is _DiskStation_ and _Conflict. The date and number varies.

Is there any way to resolve this by searching across the various folders and renaming to remove the additional text added? It wouldn't be an issue except that it has completely screwed my image catalog as that's looking at the original file name which is corrupted somehow.

Many many many thanks in advance.

Troy

Re: Rename cropping end of file name

PostPosted: Sun Apr 28, 2019 2:39 pm
by therube
So you want to rename the NewName back to OrigName?

Code: Select all
From: 3O3A1645_DiskStation_Feb-17-0231-2019_Conflict.CR2
  To: 3O3A1645.CR2


?

1:RegEx
Code: Select all
Match:  (.*?)(_DiskStation_.*_Conflict)
Replace:  \1



The overwrite part might be a problem?
I'm not really understanding the "corrupt" part?
So you may need to do something with the "corrupt" files first, not sure?

Re: Rename cropping end of file name

PostPosted: Sun Apr 28, 2019 11:53 pm
by Tromac
therube wrote:So you want to rename the NewName back to OrigName?

Code: Select all
From: 3O3A1645_DiskStation_Feb-17-0231-2019_Conflict.CR2
  To: 3O3A1645.CR2


?

1:RegEx
Code: Select all
Match:  (.*?)(_DiskStation_.*_Conflict)
Replace:  \1



The overwrite part might be a problem?
I'm not really understanding the "corrupt" part?
So you may need to do something with the "corrupt" files first, not sure?


Hi therube,

Thanks for the quick reply. Yes I need to rename the files back to the original name as it was renamed by the sync software. But as there is already a file by that name would Bulk Rename Utility overwrite the original file by default or is there a flag I can set to enable that?

Regards,
Troy