I have a reporting program that outputs ASCII reports into a folder.  If a
certain report is run more that once, the old report is not written over,
but rather, a number appended to the end of the name.

For example, I may have a report:  HTTPLogWed

If someone runs this report a second time, the new report name will be
"HTTPLogWed1".  If someone runs the report a third time, the name will be
"HTTPLogWed2".  Their file size will always be the same (e.g., 32 kb) for
the duplicate files.

What I would like to do is have a perl script look in a folder, look for
filenames that have the same name, with the exception of the last character
AND if the file's size is the same, delete the duplicate files.

So, a folder having these files:

HTTPLogWed  32 kb
HTTPLogWed1  32 kb
HTTPLogWed2  32 kb
HTTPLogWed  42 kb

The script would delete files 2 and 3, but would leave file 4 because the
file size is different than file 1.

Can Perl do this?  If so, does anyone have any advice/code/hints?

Thanks in advance

Jeremy T. Miller
Software Engineer - DynCorp
Centers for Disease Control
Atlanta, GA  30333
(404) 639-1883



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to