Oct-03-2019, 11:41 AM
(This post was last modified: Oct-03-2019, 11:41 AM by burningkrome.)
As a suggestion, look into Python's "re" module (regex). Then you could match line by line from both files.
See here for more suggestions.
Also here for how to iterate through a file.
See here for more suggestions.
Also here for how to iterate through a file.
import re s1 = "2019-10-03 text in the source file" s2 = "2019-10-03 text from the file to be searched" matches = re.search("^(\d{4}-\d{1,2}-\d{1,2})(.*)$", s1) print(matches.group(1)) # Then use an if in if matches.group(1) in s2: matches = re.search("^(\d{4}-\d{1,2}-\d{1,2})(.*)$", s2) print(matches.group(2))