|much better explanation. Thanks. here is tentative. It WILL need work/debug/tweaked.|
@echo off>drill.out & setlocal enabledelayedexpansion
>drill.out echo M48
:fixed better way: put your 4 coordinates into textfile. LEAVE FIRST LINE BLANK.
:use 1,2,3,4 to specify which one you want to use.
for /f "skip=%1" %%a in (coords) do >> drill.out echo %%a & goto :2
:drillm is name for your master file
:load variables' names and two values into matrix
for /f "tokens=1-3" %%a in (drillm) do (
:drill is name of your CAD outputfile
for /f "skip=2" %%a in (drill) do (
if /i !t0!" equ "ver" goto :done
if "!%t1%!" neq "" (
>>drill.out echo %t0%%t1%!%t1%!
>>drill.out echo %%
vbscript can do same thing, but I'm just lazy using batch for some things.