in reply to selecting corresponding lines in multiple files
The trivial way is to open A and B for reading, read one line from each, perform your match on the A line and if it matches, do work on both lines.
A slightly markedly less trivial way would be tieing the input files to arrays, looping over the A array and only when the match succeeds do some work on the nth element of the B array.
You could also paste the two input files as a preprocessing step and then use that one file as input to your script.
However, the best way IMHO is to bite the bullet and use a database instead as this is the sort of thing at which they perform really well.
🦛
|
|---|