我需要从文件中提取一些数据以将它们应用于特定过程。文件结构如下所示
some title information at file header
I001=send login information to the system
connection is OK
A001=System has answered: "you are connected"
I002=press the log out button
A002=system has answered: "You have been disconnected"
disconnection is OK
I003= timeout is 10
If timeout occurs, refresh view and then check if connection is come again
Else retry refreshment until you are connected to the system
我的目标是让 I001,I002,I003,... 保持在一条线上。为此,我写
more +1 %1 | findstr /v /r "^A...=.*"
但我明白了
I001=send login information to the system
connection is OK
I002=press the log out button
I003= timeout is 10
If timeout occurs, refresh view and then check if connection is come again.
Else retry refreshment until you are connected to the system
代替
I001=send login information to the system
I002=press the log out button
I003= timeout is 10
另一方面,请让我知道如何立即通过管道将此结果传递给使用文件作为参数的 vbs 脚本。当我使用
findstr "I[0-9][0-9][0-9]" "%~1"|cscript myscript.vbs,
我在 fsoObj.opentextfile(wscript.arguments(0),1).readall 行出现错误,使用 fsoObj=createobject("scripting.filesystemobject")。
非常感谢您的帮助