In Python I'd do the following to process a file line by line:
with open(infile) as f:
for line in f:
process(line)
Trying to look up how to do the same in elisp (with buffers instead of files), I found no obvious way.
(What I want to end up with is two ordered datastructures of lines, one with all the lines matching a regex, the other containing those that did not match.)