Taking information from a file and acting on it is something like
for $line in `cat file`
do
encode stuff
done
You would probably want to use awk or something similar to split up the lines into multiple values, though. It's been a while since I've done something like this, but for loops are definitely the way to go.