computing
  • 0

Solved Delete Last Line On a Txt File With .Bat Or MS-DOS

  • 0

i.e.

name
gender
“blank line”

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

Share

1 Answer

  1. The following is credited to nbrane September 19, 2012 at 19:46:42
    on this post(why do something thats already done :))
    https://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

    • 0