Sign in with
Sign up | Sign in
Your question

I need help mofiying a .BAT file

Last response: in Applications
Share
December 28, 2012 1:00:10 PM

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?

More about : mofiying bat file

December 28, 2012 1:22:47 PM

Hello,

Could we have more information? What this .bat file is supposed to do?

Can you copy/paste the content here?
m
0
l
December 28, 2012 2:13:47 PM

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
:D rillm 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
)
:D rill 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 :D one
set t1=!test:~3!
set t1=!t1:C0.=C.!
echo [!t0!][!t1!]
>>drill.out echo %t0%%t1%!%t1%!
)
goto :eof


goto :eof
:D one
>>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.
m
0
l
Related resources
December 28, 2012 2:15:35 PM

Looks like on my end the SMILEY face should be a D.
m
0
l
January 2, 2013 7:23:53 PM

This is not a programming question :) .
m
0
l
!