While in a Linux shell I have a string which has the following contents:
Use this (it is loop of reading each line from file
cat file | while read a; do echo $a; done
echo $a is whatever you want to do with current line.
UPDATE: from commentators (thanks!)
If you have no file with multiline, but have a variable, use
echo "$variable" | while read a; do echo $a; done