Solved delete last line on a txt file with .bat or MS-DOS

October 10, 2012 at 06:32:53
Specs: Windows XP
i.e.

name
gender
"blank line"

i cant delete this last line, i try it all, .bat, MS-DOS i need it on it


See More: delete last line on a txt file with .bat or MS-DOS

Report •


#1
October 10, 2012 at 06:56:20
✔ Best Answer
The following is credited to nbrane September 19, 2012 at 19:46:42
on this post(why do something thats already done :))
http://www.computing.net/answers/pr...

this might serve IF there are no other empty lines you want to keep:
@echo off
for /f "tokens=*" %%a in (textfil) do >>noblanks echo %%a
move /y noblanks textfil
::===== end
be sure to keep a backup copy of the original file, since that last command writes over it.

:: mike


Report •
Related Solutions


Ask Question