Hi I am trying to delete the first 3 lines from the top of multiple .txt files with a batch file. The first and second lines contain text and the third is blank. I am trying to find a way to delete the lines according to their line number.
e.g Line 1 ABCD
Line 2 EFG
Line 3
Line 4 cool this works
Line 5 line of text
Line 6 line of text
Line 7
Line 8 line of text
I have used the code below which works however, I have to give the variables as "keywords" and i want to use line numbers as variables. Also, for some reason the cursor is always creating a blank line at the top of each "new.txt" file made.
@ECHO OFF
SETLOCAL
FOR %%i IN (C:\source\*.txt) DO (
TYPE "%%i"|FINDstr /l /v "ABCD EFG" >> C:\newfiles\%%~ni.new
)
GOTO :EOF