read input files in line-by-line.