This page is edited from the 1cmdfaq.txt faq-file contained in
my tscmd.zip
command line interface (CLI) collection. That zipped file has much
additional material, including a number of detached .cmd script
files. It is recommended that you also get the zipped version as a
companion.
Please see "
The Description and
the Index page" for the conditions of usage and other such
information.
20} Is is possible to right-justify numbers or words in a script?
Yes. Basically this is the same question as padding a variable with
leading blanks. E.g. you might have within a script
set fsize_= %%~zf
set fsize_=!fsize_:~-10!
The more generic version of padding is given by the subroutine LeadVar
in
item #127.
LeadVar MyString PadWith MaxLength return_
Other cases of the padding in this FAQ include the later subroutines in
the
item #12 "How can I rename all my .JPG
files sequentially in a folder?" and the FuncRightJustify routine in
WHEREIS.CMD script included in this
collection. Furthermore, RightJustify10 in
item #8.
For left-justification see
item #96.