|
|
- @echo off & setlocal EnableDelayedExpansion
- for /f "delims=" %%i in ('"dir /a/s/b/on *.html"') do (
- set file=%%~fi
- set file=!file:/=/!
- echo !file! >> sitemap.txt
- )
复制代码
执行后得到结果
D:\wwwroot\xxx.cn\403.html
D:\wwwroot\xxx.cn\404.html
D:\wwwroot\xxx.cn\index.html
D:\wwwroot\xxx.cn\play.html
D:\wwwroot\xxx.cn\sitemap.html
D:\wwwroot\xxx.cn\1213\js\mode\clike\index.html
D:\wwwroot\xxx.cn\1213\js\mode\clike\scala.html
如何把结果中
D:\wwwroot\ 替换成 www.
\替换成/
每行尾部有空格 去掉
怎么改一下代码 得到我需要的格式的结果
我想要的结果是
www.xxx.cn/403.html
www.xxx.cn/404.html
www.xxx.cn/index.html
www.xxx.cn/play.html
www.xxx.cn/sitemap.html
www.xxx.cn/1213/js/mode/clike/index.html
www.xxx.cn/1213/js/mode/clike/scala.html |
|