对文本文档中的每个条目自动运行curl
我试图消除手动输入每个单独的选择,并让卷曲从文本文档中读取,并为文档中列出的每个选择自动运行卷曲。这是我目前拥有的基本卷曲,可以运行一个手动输入的选择。
echo AccountNumber to set
set /p AccNum =
curl -X PATCH http://localhost:3232/docs/AccountNumbers/%AccNum% -d
"@StateCountyCurl.txt" -w "\n\n"
pause
这将提示用户输入每个单独的 AccNum 并将根据 StateCountyCurl.txt 文件中的数据运行curl。我有另一个名为 AccountNumbers.txt 的文件,其中包含所有帐号。我想修改这个curl语句,以便它一一读取所有帐号并运行curl,而不必每次都手动输入每个号码。感谢您的帮助和建议。
我正在寻找类似(不确定语法)
echo AccountNumber to set
set /p AccNum = "AccountNumbers.txt" //run for every number in this text doc.
curl -X PATCH http://localhost:3232/docs/AccountNumbers/%AccNum% -d
"@StateCountyCurl.txt" -w "\n\n"
暂停的东西
I am trying to eliminate entering each individual choice manually and have the curl read from a text document and run the curl automatically for every choice listed in the document. This is the basic curl I have at the moment that can run for one single manually entered choice.
echo AccountNumber to set
set /p AccNum =
curl -X PATCH http://localhost:3232/docs/AccountNumbers/%AccNum% -d
"@StateCountyCurl.txt" -w "\n\n"
pause
This will prompt the user to enter each individual AccNum and will run the curl based on the data in the StateCountyCurl.txt file. I have another file called AccountNumbers.txt which has all the account numbers in it. I would like to modify this curl statement so that it reads all account numbers one by one and runs the curl without me having to enter each number manually every time. Thank you for your help and suggestions.
I am looking for something like (not sure of the syntax)
echo AccountNumber to set
set /p AccNum = "AccountNumbers.txt" //run for every number in this text doc.
curl -X PATCH http://localhost:3232/docs/AccountNumbers/%AccNum% -d
"@StateCountyCurl.txt" -w "\n\n"
pause
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想要使用 FOR 和 FINDSTR:
有关
FINDSTR
的更多信息: http://technet.microsoft.com/en-us/library/bb490907.aspx有关
FOR
的更多信息:http://technet.microsoft.com/en-us/library/bb490909.aspxYou want to use FOR and FINDSTR:
More on
FINDSTR
: http://technet.microsoft.com/en-us/library/bb490907.aspxMore on
FOR
: http://technet.microsoft.com/en-us/library/bb490909.aspx