I have a simple .txt file and I have to grab data specific data from that file and simply place it into another .txt file. I can do this fine, but I am trying to tell it to stop reading at a blank line. i have no clue what the character is for this. There can also be multiple sections that I have to read throughout the file so I can't just have it terminate after a set number of times. This is my code.
Code: Select all
@echo off
setlocal EnableDelayedExpansion
set flag = "N"
for /f "tokens=*" %%a in (input.txt) do (
if "%%a" == "" (
set flag=N
)
if !flag!==Y echo. %%a >> Test_Data.txt
if "%%a" == "Start_Test" set flag=Y
)
pause
Thanks for any and all help!