Aug-23-2020, 06:27 AM
(This post was last modified: Aug-23-2020, 06:28 AM by Gribouillis.)
You could try something along the line of
import re with open (hdir_f1) as cells_file: inum = set(int(match.group(1)) for match in (re.search(r"CELL\-(\d+)", line) for line in cells_file) if match) for i in range(1, 13): print('line CELL-{} - {}'.format( i, 'infile' if i in inum else 'missing'))