I need help mofiying a .BAT file

wild11fan

Honorable
Dec 28, 2012
3
0
10,510
Hello,
I have a .BAT file someone wrote for me but it doesn't work. Can someone look at it and understand what I need to fix it?
 

wild11fan

Honorable
Dec 28, 2012
3
0
10,510
Her is the drillout.bat script and extras.
@echo >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
: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 (
set x=%%a
set !x!=%%b%%c
)
:drill is name of your CAD outputfile
for /f "skip=2" %%a in (drill) do (
set test=%%a
set t0=!test:~0,3!
if /i "!t0!" equ "ver" goto :done
set t1=!test:~3!
set t1=!t1:C0.=C.!
echo [!t0!][!t1!]
>>drill.out echo %t0%%t1%!%t1%!
)
goto :eof


goto :eof
:done
>>drill.out echo %%
:end

Here is the drillm file:
C.0079F046S95
C.0091F057S95
C.0100F064S95
C.0120F077S95
C.0125F082S95
C.0135F091S95
C.0138F094S95
C.0145F100S95
C.0156F109S95
C.0158F109S95
C.0160F110S95
C.0180F111S95

Here is my Drill file:
%
M48
T01C0.0100
T02C0.0135
VER,1
%
T01
X012799Y031892
X061600Y031892
T02
X015506Y039035
X020017Y036089
M30

Here is my coords file:

G92X0625Y0
G92X0325Y0
G92X0475Y0
G92X0175Y0

This is wht the file should look like when it is output:

M48
T01C.0100F064S95
T02C.0135F091S95
%
G92x0325y0
T01
X012799Y031892
X061600Y031892
T02
X015506Y039035
X020017Y036089
M30

1)So the first % sign is to be deleted from line 1
2)T01 and T02 should be updated with the data from the drillm file from 'C' on
3)Delete the VER line
4)after the % sign should have the offset from the coords file.