中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-09 04:54
47,811 主题排行 / 349,895 发帖 / 今日 0 篇 / 48,253 会员排行
DOS批处理 & 脚本技术(批处理室) » [已結]請問For /F 要分析的檔案,路徑有空格該如何?
可打印版本  818 / 3
第1楼 XZ 发表于 2008-07-19 21:30
初级用户 发帖 65 积分 144 来自 Taiwan
[已結]請問For /F 要分析的檔案,路徑有空格該如何?
請問若For /F 要分析的檔案路徑中有空白的話要怎麼處理
因為若把路徑加上 " " 就變成分析字串了
不加上 " " 會找不到檔案
請幫幫忙 謝謝!!

執行路徑為:




DisplayDB.csv 內容


結果:


[ Last edited by XZ on 2008-7-19 at 11:47 PM ]
第2楼 metoo 发表于 2008-07-19 21:50
初级用户 发帖 93 积分 195
for /f "eol=# tokens=1,2,3* delims=, usebackq" %%i in ( "%source%\DisplayDB.csv") do (
...........
第3楼 HAT 发表于 2008-07-19 22:10
版主 发帖 5,017 积分 9,023
for /?
usebackq - specifies that the new semantics are in force,
where a back quoted string is executed as a
command and a single quoted string is a
literal string command and allows the use of
double quotes to quote file names in
filenameset.
第4楼 XZ 发表于 2008-07-19 23:46
初级用户 发帖 65 积分 144 来自 Taiwan
感謝..兩位
可以了..原來可以這樣用
不過繁中的解釋還真的比英文還難懂^^"

補上 For /? 繁中說明
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023