I'm not familiar with batch, but I do know how to copy paste and move text file to another folder... only things is now I have to add text based on certain key word in all the txt file before copy out...
it goes like this, I have a folder auto generate txt file everyday. I did make a batch to copy them to another folder everyday at a certain time.
But, before doing that.. I have to edit the content of text file whichever contain A123 on 2nd row will need to add a sentence Dept. A on the last row or end of the text.. same goes if contain B123 then add a different last sentence to the text.
So what I have in mind is to filter all txt file then add the text that match the filtering.
So, can this be done?
I tried as below batch code but return error = The filename, directory name, or volume label syntax is incorrect.
@echo off
findstr /c:"^[^ ][^ ]*A123" (*.txt) do type Dept A >> (*.txt)
exit /b
what do I need to add or change?