There are 2 txt files, the first login-pass.txt is:
login1,password1 login2,password2 login3,password3 The second list.txt is:
login1 login2 login3 In the login-pass.txt file, you need to search for lines from the list.txt file and, if they match, write to another file in the format:
login,password Found a similar script here
with open('/root/login-pass.txt') as f: haystack = f.read() if not haystack: sys.exit("Could not read haystack data :-(") with open('/root/list.txt') as f: for needle in (line.strip() for line in f): if needle in haystack: print(needle, 'FOUND!!!') But if it matches, it writes only a line from the list. only logins (more precisely, not even the script writes, but I launch it with output to a file, in general, this item suits me), please help to add / rewrite so that it writes the value from the login-pass.txt list