Jasmine Lognnes
Jasmine Lognnes

Reputation: 7087

Move column in printf?

If I do

perl -e 'printf("%2s %-5s %s\n", "a", "b", "c")'

then I get

 a b     c

Question

How can I move b e.g. 4 columns to the right, but still so it is left aligned?

(I don't suppose the correct way would be to manually insert white spaces)

Upvotes: 3

Views: 216

Answers (1)

ikegami
ikegami

Reputation: 385565

Yup. Why not?

perl -e 'printf("%2s     %-5s %s\n", "a", "b", "c")'

Upvotes: 2

Related Questions