I need a little more information. Are you just adding any text or do you need to insert it?
In any case, one easy way to get the repetition is with the perl 'x' operator, for example.
" " x 20000
will give you 20 thousand spaces.
If you have an existing string ($ s say) and want to put it at 20K, try
$s .= (" " x (20000 - length($s)))
BTW, Perl - , .
: , ( ), 20K , " ", 20K .