Actually, if your loop is doing what I think it is -- running one head, tail, awk and tr for each line in a file -- that is extremely inefficient, and should be replaced entirely with a while read loop which just reads lines directly instead of scrubbing the entire file through 3 external utilities each loop to do so.
read also has the useful feature of splitting on tokens. It can split on | for you without calling any external programs either. It works best with a predictable number of fields, since if there's more fields than variables, the last n extra fields get lumped in the last one you list.
while IFS="|" read -r VARA VARB VARC VARD VARE
do
echo "D is $VARD"
done < inputfile