help with unix printing " "

how do i print $2 amount of " " before i stat something.
so if $2 was 3 then it would print like
" d.txt"

so here there is 3 spaces before the d.txt

In what language or shell?

unix shell script

That's nice... WHAT UNIX, and WHAT shell? They're not all the same!

One way to print a fixed number of spaces (but not other chars):

printf "%20s" A B C ; echo

The "echo" is there since printf doesn't add a newline by itself.