-1
以下是Report.csv
文件,這裏我需要根據條件更新Status
列,我的文件在存在。我寫了如果文件存在與否的代碼,但不知道如何更新Status
列。批處理文件如果文件存在則更新一個csv文件
Lockbox Location Status Reason(N)
3080 Minot Y
1780 Minot N Not Scheduled
2280 Minot Y
3015 Windsor Y
2215 Windsor Y
1515 Windsor Y
29011 Windsor Y
下面是我寫的代碼。請幫助..
@echo off
setlocal
set count=0
echo %time%
echo %date%
set y=%Date:~10,5%
set m=%Date:~4,2%
set d=%Date:~7,2%
if "%time:~0,1%"==" " (set tym=0%time:~1,1%) ELSE set tym=%time:~0,2%
set tm=%tym%%time:~2,0%
echo %tm%
pause
set pattern1=INGFINS.IMAGE.image1.29011.%y%%m%%d%%tm%
set pattern2=INGFINS.IMAGE.image2.2215.%y%%m%%d%%tm%
set pattern3=INGFINS.IMAGE.image3.1515.%y%%m%%d%%tm%
set pattern4=INGFINS.IMAGE.image4.3015.%y%%m%%d%%tm%
set pattern5=INGFINS.IMAGE.image5.1780.%y%%m%%d%%tm%
set pattern6=INGFINS.IMAGE.image6.2280.%y%%m%%d%%tm%
set pattern7=INGFINS.IMAGE.image7.3080.%y%%m%%d%%tm%
IF EXIST "C:\Users\Desktop\zipLocation\*%pattern1%*.<" (
ECHO "%pattern1% exist"
) ELSE (
ECHO "%pattern1% not exist"
)
IF EXIST "C:\Users\Desktop\zipLocation\*%pattern2%*.<" (
ECHO "%pattern2% exist"
) ELSE (
ECHO "%pattern2% not exist"
)
IF EXIST "C:\Users\Desktop\zipLocation\*%pattern3%*.<" (
ECHO "%pattern3% exist"
) ELSE (
ECHO "%pattern3% not exist"
)
IF EXIST "C:\Users\Desktop\zipLocation\*%pattern4%*.<" (
ECHO "%pattern4% exist"
) ELSE (
ECHO "%pattern4% not exist"
)
IF EXIST "C:\Users\Desktop\zipLocation\*%pattern5%*.<" (
ECHO "%pattern5% exist"
) ELSE (
ECHO "%pattern5% not exist"
)
IF EXIST "C:\Users\Desktop\zipLocation\*%pattern6%*.<" (
ECHO "%pattern6% exist"
) ELSE (
ECHO "%pattern6% not exist"
)
IF EXIST "C:\Users\Desktop\zipLocation\*%pattern7%*.<" (
ECHO "%pattern7% exist") ELSE (
ECHO "%pattern7% not exist"
)
rem call "statusReport.vbs"
endlocal
pause
我看不到任何**逗號**在您的** C ** SV s充足的數據... – aschipfl