我有基于参数“连字符”创建CSV的代码,它创建了一个文件夹并将TIFF移至相应的文件夹。 需要调整代码以执行
我有执行上述操作的代码,但需要将它们组合为一个单元。
@echo off
setlocal enableDelayedExpansion
set root=D:\Testing\122
set csv=D:\Testing\122\testing.csv
set line=
set curpath=
set new=
>nul copy nul: %csv%
for /f %%F in ('dir /s/b /on %root%\*.tif') do (
if not "!curpath!" == "%%~dpF" set new=y
set fname=%%~nxF
if not "!fname:-=!" == "!fname!" set new=y
if defined new (
if defined line echo !line!>> %csv%
set line=%%~dpF
set new=
)
set line=!line!,%%~nxF
set curpath=%%~dpF
)
if defined line echo !line!>> %csv%
timeout 2>nul
set /a cnt=1
for /f "tokens=1-3 delims=," %%i in (%csv%) do (
mkdir %%ifolder!cnt!>nul
move %%i%%j %%ifolder!cnt!
move %%i%%k %%ifolder!cnt!
set /a cnt+=1
)
for /F %i in ("E:\OUTPUT\folder1") do convert %i "E:\OUTPUT\folder1\*.tif" "E:\ORIGINAL\120\001-0001.tif"