I have a report file that overwrites every 2 minutes using the same filename. Is it possible to write a batch file script to copy the file to a different directory after using findstr to learn when the file should be copied to the directory?
The contents of the file that should not be affected by the .bat file script is below:
<errors>
<error>
<description>Error rendering report: There aren't any records to display </description>
</error>
</errors>
However, the contents of the file below should be redirected using the .bat file script.
...8A-2,987654321,Hal....
My initial thougt was a nested findstr and copy command inside of a for command. using my keyword as 987654321.
(Note: The file has many records that will need to be copied to the new directory for further processing.
After looking at some examples and KB documents, this is what I was able to create.
for /f delims=, %i in (<path A>) do (findstr ,900* <path B>) &&
(robocopy <path A> <path B> /XX TEST_BbSalto.txt /LOG+:<path D>)
(Note: The true path has been replaced with placeholder text.)