At a command line in Windows, I want to search through a specific file and if it finds 2 instances of a line beginning with the same alphacharacters, then it needs to run a a specific vbs script.
For instance, in file located at c:\info\input.txt
Searching through the file,
If there are two lines in succession which start with DTM*, then it needs to run a cscript of 2.vbs, however if it finds
only 1 line starting with DTM* on it's own, then it needs to run 1.vbs.
What command line commands can I use to accomplish this?
Thanks.
Open in new window
Edit: Forgot to ask: do you need to pass the file to analyze as command line argument, or can it remain hardcoded?