0

So im writting a python script that gets all the path files of documents in an specific directory but i need to get the path for the latest version of the document.

So imagine the below list is a directory that have 4 documents where 2 are different version of the same file.

Directory = ["AB CD - v3.xlsm", "AB CD - v4.xlsm", "Shipping - v3 (reviewed).xlsm", "Shipping - v4.xlsm"]

So i want to get the file path of the latest version of each document, that would be "AB CD - v4.xlsm" and "Shipping - v4.xlsm"

There is no need to write the code to get the file path just the part on how to select the latest version of each document.

Thanks in advance.

  • whats the difference between "AB CD - v4.xlsm" and "AB CD - v4.xlsm"? (Second and last item in Directory). If these are two different versions of the same file, and they have the same filename, how they can be located in the same Directory? – user40 Mar 23 '21 at 13:32
  • have you tried using the answer from here? https://stackoverflow.com/questions/39327032/how-to-get-the-latest-file-in-a-folder instead of passing all files from a folder you can pass only the list of filenames with different versions and then chose the latest one using the mentioned answer – user40 Mar 23 '21 at 13:40

0 Answers0