@echo off setlocal set "SECRET=for /f "delims=" %%L in (input.txt)" // reads text line by line // set "URL=curl --data-binary '' "http:localhost:port/page?requestType=SECRET=" // a line from input.txt will be set after SECRET= to test then move to another line
等..//
set "LOG=C:\output.txt" // save results >"%LOG%"
我正在尝试做这项工作。请帮忙。感谢
答案 0 :(得分:1)
试试这样:
@echo off
(for /f "delims=" %%a in (input.txt) do (
echo curl --data-binary '' "http:localhost:port/page?requestType=SECRET=%%a
))>output.txt
编辑:
我认为您正在尝试这样做:
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%a in (input.txt) do (
curl --data-binary '' "http:localhost:port/page?requestType=SECRET=%%a >output.txt
for /f "tokens=6 delims=,:}" %%b in (output.txt) do (
set "$Value3=%%b"
echo !$Value3:~1,-1! >%%a_Result.txt
)
这将为Secret_Result.txt