Create a small Dictionary [ A B C ]
Posted: 29 Aug 2016 10:43
everybody
Thank you so much.
I want to make a small batch to create a small dictionary :
the SOURC.txt Contain:
abc
Bat I would like an out as follows ,Out-Dic.txt:
a
b
c
aa
ab
ac
ba
bb
bc
aaa
aab
aac
aba
abb
...
cccc.
Thank you so much.
I want to make a small batch to create a small dictionary :
Code: Select all
@echo off
setlocal enableDelayedExpansion
(
(
call :One
) < "SOURC.txt"
) > "Out-Dic.txt"
endlocal
goto :eof
:One
set "bu="
set "input="
set /P "input="
set "buffer= !input!"
set "Next="
set i=0
:Two
set "lastByte=!buffer:~1,1!"
if defined lastByte (
set "bu=!bu!!Next!!buffer:~1,1!"
rem echo(!bu!
echo(!Next!!buffer:~1,1!
set "buffer=!buffer:~0,1!!buffer:~2!"
goto :Two
) else if defined input (
set /A i+=1
set "Next=!input:~%i%,1!"
set "buffer= !input!"
if defined Next goto :Two
)
goto :eof
the SOURC.txt Contain:
abc
Bat I would like an out as follows ,Out-Dic.txt:
a
b
c
aa
ab
ac
ba
bb
bc
aaa
aab
aac
aba
abb
...
cccc.