Am I missing something here?
while read will continue reading until the read returns a non-zero exit status, i.e. when there are no more lines to read.
I'd do away with needless cat and temporary variable assignments too.
Code:
while read line
do
# do your parsing here, e.g.
echo "$line"
done < yourInputFile >> yourOutputFile