If I understood what you want is a function to leave certain number of spaces after a specified string. Here it is:
fix_space() { string="$1" len="$2" perl -e "my \$str = '`printf "$string" | sed "s/'/\\'/g"`'; print \$str.' ' x ($len - length(\$str))" } echo "'`fix_space "ololfdsaf" 20`'" echo "'`fix_space "ololff" 20`'"
It simply makes perl
doing all the dirty job. String goes as the first argument, and the full length as the second. I am sure this will help you to align your output.
EDIT:
You can do it without perl
with only using shell. Then you have to type:
printf "'$string`printf ' '%.0s ))}`'\n"