BATCH - Work with string (<,>) instead of redirecting
The last word in each text in the test.txt file is "</a>", I echo this word out and it doesn't seem to be a problem, but when I echo out in the for loop, cmd gave me this error: "The system is not can find the specified file. "
I know the problem is "<" and ">", this means redirecting that as an error is created. How am I going to make cmd, think I'm working with a string instead of a redirect?
@echo off setlocal EnableDelayedExpansion set "remove_char=< /a>" echo !remove_char! for /f "skip=2 tokens=6*" %%a in (testing.txt) do ( set "string=%%a %%b" set string=!string:%remove_char%=! echo !string! ) pause >nul