I have 3 folders named like FOLDER1, FOLDER2, FOLDER3 and I have couple of files in those folders like wise file1.txt, file2.txt, file3.txt .... etc. ( in those 3 folder don't have sub folders).
In those folders some files are duplicates.
FOLDER1 has file1.txt and FOLDER2 also has file1.txt
OR
FOLDER2 has file1.txt and FOLDER3 has file1.txt
OR
FOLDER1 has file1.txt and FOLDER3 has file 1.txt.
Need to rename another duplicate file1.txt in another folder as file1DUPLICATE.txt.
Suppose if FOLDER1 and FOLDER2 have file1.txt, I need to rename the file1.txt in the FOLDER1 as file1DUPLICATE.txt and retain the file1.txt in the FOLDER2 as original.
If duplicate occurs in FOLDER1 and FOLDER2 I need to rename in the FOLDER1 only.
If Duplicate occurs in the FOLDER2 and FODLER3, I need to rename in the FOLDER3 only.
Simply I dont want to rename the files in the FOLDER2
If duplicate occurs in the FOLDER1 and FOLDER3, I can rename the file.txt whichever folder I want.
Anyone have idea for implementing the script for that ?