On 27 December 2016 at 22:49, JD <jd1008(a)gmail.com> wrote:
Reading lines from 2 files in such a way that each iteration
lets me read the next line from each file so that the items
read from each file are in sync as far as line number is concerned.
Is this "doable"?
Maybe a little out of the box, but far simpler than the other
solutions so far if it'll do what you need:
egrep -Hn . <file1> <file2> | sort -t: -k2 | cut -d: -f3-
It'll work with any number of input files, wildcards, and you play
with the sort/cut parts to get more descriptive output if you want as
well, e.g:
egrep -Hn . <file1> <file2> ... <filen> | sort -t: -k2 | cut -d:
-f1,3-
Andy
--
The only person to have all his work done by Friday was Robinson Crusoe