Replace Existing files on truncate of file name

Advanced Renamer forum
#1 : 11/08-14 19:21
WildPetals
WildPetals
Posts: 1
hi

A restore from carbonite has been done to the directories.. now we have files that are the right ones (they all have the string: (Restored) starting at the 28th character from the end.

unfortunately, whomever did the carboite restore put only selected files (xls, doc, ppt, etc) and left the others as is. so i can't just delete all the files. When i truncate the name... the other file exists. (THEY are frozen by the Krypto virus)... so i just want them gone. But I have to leave the other files that were not affected in place.

how can i

1. test for existence of a file name (BEFORE THE RENAME),
2. delete the already existing file (OR APPEND DELETEME to the file name of the pre-existing file), then
3. Then truncate the last 28 characters of the file so it is properly named and in the right place, thus preventing a duplicate file situation or worse, adding characters to the end of the valid file

I have to do this for all files under a directory too. (There are countless directories where files are stored).

I really appreciate your assistance.

Have a great day and smiles your way.. Laura



11/08-14 19:21