下面代码作用是从 1.txt 中读取内容,组合成字符串 ="http://dict.cn/ws.php?q=%w%"
------------------------------------------------------------------------------------------------
1.TXT 内容
china
apple
list
循环后字符串
"http://dict.cn/ws.php?q=china"
"http://dict.cn/ws.php?q=apple"
"http://dict.cn/ws.php?q=list"
问题是运行下面代码后,一直Echo 不出 %url% 中希望内容?
code:
@echo off
setlocal enabledelayedexpansion
set "command1=wget -q -O - "
for /f "delims=" %%w in (1.txt) do (
set url="http://dict.cn/ws.php?q=%w%"
echo %%w
echo %url%
)
)
------------------------------------------------------------------------------------------------
1.TXT 内容
china
apple
list
循环后字符串
"http://dict.cn/ws.php?q=china"
"http://dict.cn/ws.php?q=apple"
"http://dict.cn/ws.php?q=list"
问题是运行下面代码后,一直Echo 不出 %url% 中希望内容?
code:
@echo off
setlocal enabledelayedexpansion
set "command1=wget -q -O - "
for /f "delims=" %%w in (1.txt) do (
set url="http://dict.cn/ws.php?q=%w%"
echo %%w
echo %url%
)
)
