Read a text file line by line in Bash

The code is very simple:

while read line; do echo $line; done < file.txt

To output the result to another text file, for example after some text manipulation:

while read line; do echo "Manipulated $line"; done < file.txt > output.txt