Solved batch 'lack of better name here'

Hewlett-packard Pavilion dv6-2190us note...
March 6, 2012 at 10:29:43
Specs: Win 7, Core i5 / 4 gigs
I'm trying to create a batch file that can create names like this
i'm familiar with for /l but i don't see how to do it
nnn111
nnn112
nnn113
nnn999
nnm000
nnm001
nnm002
.
.
.
zzz998
zzz999
zzz000

See More: batch lack of better name here

Report •


✔ Best Answer
March 6, 2012 at 17:05:50
here ya go, its just 6 nested for loops:
for /f "skip=14" %%a in (output.bat) do (
for /f "skip=14" %%b in (output.bat) do (
for /f "skip=14" %%c in (output.bat) do (
for /l %%d in (0,1,9) do (
for /l %%e in (0,1,9) do (
for /l %%f in (0,1,9) do (
echo %%a%%b%%c%%d%%e%%f >> output.txt
)
)
)
)
)
)

a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z

btw your file has to be named output.bat to work, else change the "output.bat" in the for loops to the name of your file (and it never will output dots idk what those are supposed to do... so it just counts in your order, and it takes forever...)



#1
March 6, 2012 at 11:57:36
can't it be a VBS file?

Report •

#2
March 6, 2012 at 12:41:09
it could, but i'd like it to be something that i can program myself. as I'm more educated in batch and dos

Report •

#3
March 6, 2012 at 12:46:51
Arbitrary base (26) with arbitrary symbols (a-z) are better done with better languages. I see you asked about Matlab, maybe that language can do what you want? (Also, there's no relation between DOS and modern Windows. None. At all.)

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
March 6, 2012 at 15:51:21
this can be done fairly easily, in batch it would be no different from another language

anyway I'll do it, but I would like you to clarify - are the dots names? and could you give me a longer list possibly?


Report •

#5
March 6, 2012 at 16:28:23
yes the dots are names
and the dots signify stuff after after that point zzz999 is where it should stop

it's nothing more than a counter
aaa000
aaa001
aaa002
aaa003
aaa004
aaa005
aaa006
aaa007
aaa008
aaa009
aaa010
aaa011
aaa012
aaa013
aaa014
etc.
aaa999
aab000
aab001
etc.


Report •

#6
March 6, 2012 at 16:29:47
i'm talking about the language in general i'm viced in what it is and how to operate it. matlab is something seperate.

Report •

#7
March 6, 2012 at 17:05:50
✔ Best Answer
here ya go, its just 6 nested for loops:
for /f "skip=14" %%a in (output.bat) do (
for /f "skip=14" %%b in (output.bat) do (
for /f "skip=14" %%c in (output.bat) do (
for /l %%d in (0,1,9) do (
for /l %%e in (0,1,9) do (
for /l %%f in (0,1,9) do (
echo %%a%%b%%c%%d%%e%%f >> output.txt
)
)
)
)
)
)

a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z

btw your file has to be named output.bat to work, else change the "output.bat" in the for loops to the name of your file (and it never will output dots idk what those are supposed to do... so it just counts in your order, and it takes forever...)


Report •

#8
March 6, 2012 at 17:07:05
and it outputs all the info to a .txt file called output.txt

Report •

#9
March 6, 2012 at 17:39:35
echo off
cls
setLocal EnableDelayedExpansion
set Str=abcdefghijklmnopqrstuvwxyz
set Num=0

for /L %%a in (%%a,1,26) do (
for /L %%b in (%%b,1,26) do (
for /L %%c in (%%c,1,26) do (
for /l %%d in (0,1,9) do (
for /l %%e in (0,1,9) do (
for /l %%f in (0,1,9) do (
echo !str:~%%a,1!!str:~%%b,1!!str:~%%c,1!%%d%%e%%f

)
)
)
)
)
)


thanks dude that bit of code got me thinking, perfect! i knew there was a way to do it :) now it works just the way i wanted it to :) :) :) oh I'm so happy


Report •

#10
March 7, 2012 at 14:40:19
lol, np, and thanks for showing me a little less ridiculous way of doing that

Report •

#11
March 7, 2012 at 17:42:24
No Problem :) i figured the way i was thinking of had to combine a few of the counting programs i already had. i just couldn't wrap my head around the way you had done it

Report •


Ask Question