当前位置: > 下面for /f %%i in (db.udl) do (echo.%%i) 循环中为什么有分号那句不能显示...
题目
下面for /f %%i in (db.udl) do (echo.%%i) 循环中为什么有分号那句不能显示
--------------------------------db.udl---------------------------
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Password=aaaa;Persist Security Info=True;User ID=chooa;Initial Catalog=aaaa;Data Source=db_server
--------------------------------end-----------------------------------
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=*" %%i in (db.udl) do (
echo.%%i
)
pause
-------------------------------显示结果-----------------------------
[oledb]
Provider=SQLOLEDB.1;Password=aaaa;Persist Security Info=True;User ID=chooa;Initi
al Catalog=aaaa;Data Source=db_server
----------------------------------------------------------------------
; Everything after this line is an OLE DB initstring 这句如何才能显示?

提问时间:2020-10-08

答案
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "eol= delims=* tokens=*" %%i in (db.udl) do (
echo.%%i
)
pause
你现在试试吧?
for 命令中,有一个参数eol,它指的是忽略以什么符号开头的行,默认的好像是;号.
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.