标题:
有什么办法可以简化代码?
[打印本页]
作者:
tanytxxx
时间:
2009-12-25 16:47
标题:
有什么办法可以简化代码?
找出当天被改动个的文件和新增加的文件,删除一些字符
forfiles /p F:\www\html /s /d %date:~0,10% /c "cmd /c echo @path">file.txt
forfiles /p F:\www\txt /s /d %date:~0,10% /c "cmd /c echo @path">>file.txt
FOR /F "skip=1 tokens=*" %%i in (file.txt) do fr %%i *.txt *.html -fic:天地文学 -t:
FOR /F "skip=1 tokens=*" %%i in (file.txt) do fr %%i *.txt *.html -fic:天下文学 -t:
FOR /F "skip=1 tokens=*" %%i in (file.txt) do fr %%i *.txt *.html -fic:中华文学 -t:
FOR /F "skip=1 tokens=*" %%i in (file.txt) do fr %%i *.txt *.html -fic:
www.asasas.net
-t:
FOR /F "skip=1 tokens=*" %%i in (file.txt) do fr %%i *.txt *.html -fic:
www.aqaqaq.net
-t:
FOR /F "skip=1 tokens=*" %%i in (file.txt) do fr %%i *.txt *.html -fic:
www.qqqwqw.com
-t:
FOR /F "skip=1 tokens=*" %%i in (file.txt) do fr %%i *.txt *.html -fic:
www.zzazaz.com
-t:
有什么办法可以简化代码,
www.zzazaz.com
用www.*com代替又总是不成功。
[
Last edited by tanytxxx on 2009-12-25 at 22:19
]
作者:
chenall
时间:
2009-12-26 01:37
直接把后面的for /f合成一句啊,由于对fr的功能不太清楚,所以只能简化到如下了。
FOR /F "skip=1 tokens=*" %%i in (file.txt) do (
fr %%i *.txt *.html -fic:天地文学 -t:
fr %%i *.txt *.html -fic:天下文学 -t:
fr %%i *.txt *.html -fic:中华文学 -t:
fr %%i *.txt *.html -fic:
www.asasas.net
-t:
fr %%i *.txt *.html -fic:
www.aqaqaq.net
-t:
fr %%i *.txt *.html -fic:
www.qqqwqw.com
-t:
fr %%i *.txt *.html -fic:
www.zzazaz.com
-t:
)
作者:
tanytxxx
时间:
2009-12-26 08:48
谢谢2楼,
作者:
yishanju
时间:
2009-12-26 13:35
FR 支持递归了目录,支持通配符,跟本就不需要用到FOR
fr -ric:"天地文学|天下文学|中华文学|www\.xxx\.com|www\.bbb\.net" -t:"" -s f:\www\ *.txt *.html
欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/)
Powered by Discuz! 2.5