Ivo as help me to build this batch, now my problem is that I need to run this batch inside another batch, and what happens is that when it runs this part it runs properly, but then exit and it does not run the rest of the batch file, I think it is because of the "exit" at the end, but if I remove the exit it will loop and it will never end, is there a way to not stop running it?
@echo off & setlocal EnableDelayedExpansion > "File.new"
for /F "delims=" %%j in ('type "File.txt"') do call :CLEAN %%j
for /L %%k in (17 1 34) do if "!line:~%%k,1!"=="0" (set /A cnt+=1) else (goto :DONE)
set /A pos= 17 + %cnt%
set /A lgt= 18 - %cnt%
if %cnt% gtr 0 (
for /L %%k in (1 1 %cnt%) do (set filler=!filler! )