Jump to content

Need help with StringFormat


Geert
 Share

Recommended Posts

I wrote a script with a simple filename-counter in it. In the output I will add this counter as a prefix for the filename:

1 shell32.dll

2 system.ini

3 explorer.exe

...

I would like to have the numbers in four digits:

0001 shell32.dll

0002 system.ini

0003 explorer.exe

0256 test.txt

...

I would like to use StringFormat but I don't know how to specify the 'format control' of the StringFormat command.

Link to comment
Share on other sites

I wrote a script with a simple filename-counter in it. In the output I will add this counter as a prefix for the filename:

1 shell32.dll

2 system.ini

3 explorer.exe

...

I would like to have the numbers in four digits:

0001 shell32.dll

0002 system.ini

0003 explorer.exe

0256 test.txt

...

I would like to use StringFormat but I don't know how to specify the 'format control' of the StringFormat command.

$sFormattedFileName = StringFormat("%04d %s", $nCounter, $sFileName)
Edited by SumTingWong
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...