Duplicate Validation

@balaji.nama
Another technique is to fill up maintain the filenames and uplicates within a dictionary (of String, string)

While downloading check if the filename is available as key in the dictionary e.g. dictNames
If Not avaialable: insert the filename as Key and Value: e.g. dictNames(“Abc.txt”) = Abc.txt
If Available:

  • retrieve the value val = dictNames(“Abc.txt”)
  • do the modification on the filename e.g. Abc_2.txt
  • store the new filename back dictNames(“Abc.txt”) = Abc_2.txt

Sure you can modify the pattern and e.g store a filename counter on the value

1 Like