That's a very common question, and it has been answered here on LQ quite a few times.
Most would recommend using a while
loop and input redirection:
while read x ; do
[... process $x here and write the results to another file ...]
done < input_file
A quick search of the LQ forums should turn up a few examples.