Feb-08-2018, 04:27 PM
Instead of
break
ing when you find a match, maybe keep a list of matches?matches = [] with open("jobs.txt") as jobs: for line in jobs: record = line.split("|") if jobname in record[0]: matches.append(record) if matches: for record in matches: print(record[0], record[1]) else: print("Job name not found")