thanks aGerman. working perfectly.
there is a slight problem i have encountered aGerman when multiple folders are on the root drive:
00002073
00002073_001
00002073_002
00002073_003
00002073_004
00002073_005
00002074
00002074_006
00002074_007
00002074_008
00002074_009
00002074_010
it increments also the next folder, is there a way i can fix that?
how do you code this [updated]
Moderator: DosItHelp
Re: how do you code this
That's a joke, isn't it
Regards
aGerman
Code: Select all
@echo off &setlocal
set "sourceroot=C:\TPP"
cd /d "%sourceroot%" ||goto :eof
for /f "delims=" %%a in ('dir /ad /b^|findstr /rxc:"[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"') do (
del "%%a\%%a.idx"
for /f "delims=" %%b in ('dir /ad /b "%%a"') do (
>>"%%a\%%a.idx" type "%%a\%%b\%%b.idx"
move "%%a\%%b\*.tif" "%%a\"
rd /s /q "%%a\%%b"
)
)
Regards
aGerman
Re: how do you code this [updated]
i'm not joking aGerman. im on a batching and merging process that's why it should be done that way. By the way,there is a slight problem i have encountered aGerman when multiple folders are on the root drive:
00002073
00002073_001
00002073_002
00002073_003
00002073_004
00002073_005
00002074
00002074_006
00002074_007
00002074_008
00002074_009
00002074_010
it increments also the next folder, is there a way i can fix that?
00002073
00002073_001
00002073_002
00002073_003
00002073_004
00002073_005
00002074
00002074_006
00002074_007
00002074_008
00002074_009
00002074_010
it increments also the next folder, is there a way i can fix that?
Re: how do you code this [updated]
My fault.
Regards
aGerman
Code: Select all
@echo off &setlocal enabledelayedexpansion
set "sourceroot=C:\TPP"
set /a lines=100
cd /d "%sourceroot%" ||goto :eof
for /f "delims=" %%a in ('dir /ad /b^|findstr /rxc:"[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"') do (
set /a n=0, base=1000
for /f "usebackq tokens=* delims=" %%b in ("%%a\%%a.idx") do (
set /a r=n%%lines, n+=1
if !r!==0 (
set /a base+=1
set "outfolder=%%a\%%a_!base:~-3!"
md "!outfolder!"
set "outfile=!outfolder!\%%a_!base:~-3!.idx"
>"!outfile!" type nul
)
>>"!outfile!" echo %%b
for /f "tokens=5 delims=," %%c in ("%%b") do move "%%a\%%~c" "!outfolder!\"
)
)
Regards
aGerman
Re: how do you code this [updated]
working perfectly, thanks you very much aGerman. You're the best.
By the way, can I use the built-in zip utility of XP/7 through command line? I don't want to use any 3rd party zip program. The only way I can thought is using vbs scipt. Is that possible?
By the way, can I use the built-in zip utility of XP/7 through command line? I don't want to use any 3rd party zip program. The only way I can thought is using vbs scipt. Is that possible?