Solved Edlin in a batch file; crop out all above and below one line

November 22, 2012 at 00:53:21
Specs: WindowsXP, 8 gigs ram
Using a batch file, I need to get Edlin to crop all lines of text above and below the line that I wanted to save in a text file - So lets say 15 lines of this text file. I want to save only the 10th line. I want to remove lines 1-9 And 11-15.

This 10th line would be saved in a txt file on its own. I dont need the original file or its contents.
This file will never change in amount of lines it will have.
This is in WinXP from DOS CMD line.
Thank you for all assistance.


See More: Edlin in a batch file; crop out all above and below one line

Report •


#1
November 22, 2012 at 09:49:50
✔ Best Answer
for /F "skip=9 delims=" %%i in ('type "MyFile.txt"') do (@echo.%%i>> "NewFile.txt" & exit)


Report •

#2
November 22, 2012 at 16:20:55
@echo 11,#d;1,9d;e| edlin myfile

Report •

Related Solutions


Ask Question