Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
@echo offsetlocal enabledelayedexpansionset switch=0for /f "delims=" %%A in ('dir /s /b *.c') do ( for /f "delims=^( tokens=1*" %%B in (%%A) do ( if !switch! equ 0 ( if "%%B"=="ROM_START" (set switch=1) echo %%B^(%%C >>temp.txt ) if !switch! equ 1 ( if "%%B"=="ROM_END" ( set switch=0 echo ROM_END >> temp.txt ) ) echo del %%A echo ren temp.txt %%~nxA ))