Hi, I am new programming and I have been experimenting doing some scripts that have helped me a lot in my work, I would like in this case to be able to advance more with a script but I can not find a way to achieve what I want to do.
My script is:
with open('D:/Python/detectar_coincidencias/Emails/00AA34B3078446DB90C489BAFF37B611.MAI', 'r') as file1:
with open('D:/Python/detectar_coincidencias/Emails/0AFA934556264ABFA0FC901F12786D29.MAI', 'r') as file2:
same = set(file1).intersection(file2)
same.discard('\n')
with open('some_output_file.txt', 'w') as file_out:
for line in same:
file_out.write(line)
This only helps me to see two files in a single folder but I would like you to detect the number of files with .MAI extension in this folder and be able to compare them in some way and write the matches found in another new file.
Can you help me by giving me some clues or some solutions on how to achieve it?
Greetings and thank you very much!