@echo offset tmpstr=setlocal enabledelayedexpansionfor /f "tokens=*" %%i in (1.txt) do set tmpstr=!tmpstr! %%iecho %tmpstr%>3.txtexit