|Im trying to find the best way of handling the results a find command, i want to see if theres away to pipe the results straight to a variable instead of going through a temp file. |
I need the command to search a file for the text "DVL error" and if it exists then it needs to send a variable to another text file, however i'm having some issues.
I've only been doing batch scripting for around 4 days last time i did any was about 7 years ago.
Heres the script snippet:
:: Check to see if we got a DVL error and if so send this spot to our results list
for %%a in (%downloadTo%\testspot.txt) do find "DVL error" < %%a >> %downloadTo%\temp.txt
for %%a in (%downloadTo%\temp.txt) do (
IF "%resultsInFile:~,9%" == "DVL error" echo %spotName% >> %downloadTo%\%boxName%_results.txt
If the temp.txt file looks like this the script should pick up a match:
DVL error 13: specified video file does not exist
The only other state for this file should be that its empty.
Right now whats happening is that the script is printing this:
Which means that its not seeing whats in the file itself just the name of the file itself.