CODE: [Copy to clipboard]@echo off for /f "delims=" %%a in (1.txt) do ( set "str=%%a" call echo %%str:~0,-1%%_ ) pause