Over 10 years ago, Mike asked the question "How can I use a file in a command and redirect output to the same file without truncating it?" for bash
. I would like to ask the same question for the Windows command processor.
The requirement is doing this without creating any temporary files. Thus, AFAIK, answers involving piping will not be suitable.
This is my current code, but the output will always be 0 bytes, likely because the command processor creates the output redirection before reading the source file:
findstr.exe /v /c:"test string" file_name >file_name