May-30-2021, 07:49 PM
You guys are awesome!
Each time I have a problem with a code I come here, I always get helped without an 'attitude' of the 'StackOverflow.
And even more, I get much-needed coaching...
To ibreeden:
Thank you! I'm confused about flags, totally missed it
The files I'm working with are changing file Names each time a new file added to the file's directory but the timestamp is staying the same.
The file "\\D1376\d$\logs\BBLog.1.xml,05/28/2021 17:02:03" will be "\\D1376\d$\logs\BBLog.5.xml,05/28/2021 17:02:03" tomorrow or "\\D1376\d$\logs\BBLog.25.xml,05/28/2021 17:02:03" in a week.
To find it tomorrow or in a week I must keep a file's list of yesterday's with the timestamps. That is why I'm using a 'timestamp' as an identifier of a file, not the filename. I'm not sure it is the best way to do this kind of search but this is what I came up with.
To snippsat:
Thank you for the snippet!
I see your point and I was thinking about using 'set' but not sure it will do the job when the names of the files I'm working with are changing and only the timestamp stays the same.
Each time I have a problem with a code I come here, I always get helped without an 'attitude' of the 'StackOverflow.
And even more, I get much-needed coaching...
To ibreeden:
Thank you! I'm confused about flags, totally missed it

The files I'm working with are changing file Names each time a new file added to the file's directory but the timestamp is staying the same.
The file "\\D1376\d$\logs\BBLog.1.xml,05/28/2021 17:02:03" will be "\\D1376\d$\logs\BBLog.5.xml,05/28/2021 17:02:03" tomorrow or "\\D1376\d$\logs\BBLog.25.xml,05/28/2021 17:02:03" in a week.
To find it tomorrow or in a week I must keep a file's list of yesterday's with the timestamps. That is why I'm using a 'timestamp' as an identifier of a file, not the filename. I'm not sure it is the best way to do this kind of search but this is what I came up with.
To snippsat:
Thank you for the snippet!
I see your point and I was thinking about using 'set' but not sure it will do the job when the names of the files I'm working with are changing and only the timestamp stays the same.
tod = set((line.strip() for line in open('tod1376.txt'))) yrd = set((line.strip() for line in open('yrd1376.txt'))) with open('File_diff.txt', 'w') as diff: for line in tod: if line not in yrd: diff.write(line) print(f"{line}")Thank you again!