Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I needs to format a variable. my variable contains number. and i want to achieve some thing like RPAD in oracle. basically i want fix length string which contain data in my variable along with zero padded at right side. Say my variable contains 123 and I want it shown as 0000123. how can I achieve this.Thanks in advance.

"This forum is for all Standalone versions of DOS, not the "DOS" prompt contained inside later versions of Windows."
Perhaps the Programming forum would be more suitable?
We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true

::== padvar.bat
@echo offset myvar=%1
if %myvar% lss 10 set myvar=000000%myvar% & goto :eof
if %myvar% lss 100 set myvar=00000%myvar% & goto :eof
if %myvar% lss 1000 set myvar=0000%myvar% & goto :eof
if %myvar% lss 10000 set myvar=000%myvar% & goto :eof
if %myvar% lss 100000 set myvar=00%myvar% & goto :eof
if %myvar% lss 1000000 set myvar=0%myvar% & goto :eof
:: DONE
=====================================
If at first you don't succeed, you're about average.M2Go

Hi jboy,
oops, spaced out.
espresso maker is broke.
LOL
=====================================
If at first you don't succeed, you're about average.M2Go

Ah well - their first post was deleted, but I gather if one just keeps on reposting, problem solved.
Me, I don't really care (this forum isn't what it used to be) - sure would be nice to know which particular days of the week (or perhaps cycles of the moon) these rules & warnings are applicable
I suppose consistancy really is 'the hobgoblin of small minds'
We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true

Yeah, that bat surely won't work in DOS.
The failure to read and heed forum guidelines is, sadly, not confined to this forum.
The bit that most often gets blown off is, "state EXACT OS and hardware".
=====================================
If at first you don't succeed, you're about average.M2Go

Why, it's "DOS" (of course - heh)
You can even post unrequested HJT logs now too
I won't even mention that nonsense in 9x last Friday...
We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true

I used Slackware Linux, when in Console Mode it has Black Background White Text, it looks like XP DOS !!!!!!!!!!!!!!!!!!!!!!!!!

Yes, well the uninformed from all walks of life seem to feel that any onscreen text (even that generated by the BIOS) is "DOS"
Thanks for the update
We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true

One of my personal favs was the guy who had [IIRR] an IBM laptop with a BIOS ver 6.23 and he was asking questions about "DOS 6.23" LOL.
=====================================
If at first you don't succeed, you're about average.M2Go

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |