To read the first 5 lines into 5 different variables:
for i in `seq 1 5`; do read var$i ; done < filename
This gives one example of how "read" works. As for formatting, read up on printf.
The best guides are at http://tldp.org
Look for Bash Guide for Beginners and the Advanced Bash Scripting Guide