I am saving mail attachments, reading, sorting, moving and renaming the files into categories based on its contents.
For each file that has Condition X I move and save the file as filename condition X
My problem is that my loop gets an error when it tries to save the second file with condition X in the folder. Error msg says It cant create a new file, when the file already exists. (same name). So I want each file til be named Condition X 1, Condition X 2, Condition X 3 etc.
How do i add the (+1) to the destination filename?