bat写循环

For循环:

REM Get the start, end and step values
SET start=20000000
SET end=20030000
SET step=1

REM Remove Padding
FOR /l %%x in (%start%, %step%, %end%) DO ( 
    ECHO DD1805400190%%x^|10^|20200906^|4166.67^|855.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|N^|^| >> 30000bids.txt
    ECHO DD1805400190%%x^|11^|20201006^|4166.67^|855.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|N^|^| >> 30000bids.txt
    ECHO DD1805400190%%x^|12^|20201106^|4166.63^|855.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|0.00^|N^|^| >> 30000bids.txt
)

^|为转义

参考:https://www.656463.com/wenda/WindowsBatxunhuantianchongfanwei_561

 

loop循环:

@echo off

:loop
if "%1"=="" (GOTO :END)^
else (for %%a in (%1) do set b=%%~nxa
if "%b%"=="" (echo "**********Did not get the folder name, please try again**********"&GOTO :END)

md D:\statsvn\%b%&cd D:\statsvn\%b%
svn co --username test_postLoan %1 D:\statsvn\%b%\%b%
svn log --username test_postLoan -v --xml D:\statsvn\%b%\%b%>D:\statsvn\%b%\%b%\svn.log
java -jar D:\statsvn\statsvn.jar D:\statsvn\%b%\%b%\svn.log D:\statsvn\%b%\%b% -charset GBK
rd/q/s D:\statsvn\%b%\%b%&cd ..
shift /1&goto :loop)

:END

 

posted @ 2020-05-13 14:05  carlvine  阅读(976)  评论(0编辑  收藏  举报