I need a batch file to delete the last line in every .csv file in a folder. I’ve seen serveral similar post, but nothing that works. Please helk!
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
@echo off
setlocal enabledelayedexpansion
set /a p_max=0
for /F “tokens=*” %%a in (test.txt) do (
set /a p_max=!p_max!+1
)
set /a cnt=1
for /F “tokens=*” %%a in (test.txt) do (
if !cnt! LSS %p_max% echo %%a
set /a cnt=!cnt!+1
)