@echo off
for /f %%a in (Response.txt) do if /i "%%a"=="Yes" ECHO Week >"Week A.txt"
Will create "Week A.txt" if any line in response.txt
has a first word "Yes" in any case.
Beyond that, you'll have to explain further what you want to do.
سؤال
I am trying to get a batch script to read the text from a document called "Response.txt". I can't seem to get it to read the text inside the file. The file says Yes. I want it to create a new text file to say week A if "Reponse.txt" = Yes.
@echo off
IF Response.txt = Yes
goto next
:next
ECHO >Week.txt
ECHO Week >Week A.txt
المحلول
@echo off
for /f %%a in (Response.txt) do if /i "%%a"=="Yes" ECHO Week >"Week A.txt"
Will create "Week A.txt" if any line in response.txt
has a first word "Yes" in any case.
Beyond that, you'll have to explain further what you want to do.