I have a file as follows
PARTNO TEST
%
O251(TEST)
G1X-.0184Y-.8618Z.7723A355.0F10
G8Y-.8452Z.7708A.0
X-.0185Y-.8284Z.7694A5.0
X-.0187Y-.8115Z.7679A10.0
X-.0188Y-.7945Z.7664A15.0
X-.0189Y-.7773Z.7649A20.0
X-.019Y-.7601Z.7634A25.0
X-.0185Y-.8284Z.7694A-5.0
X-.0187Y-.8115Z.7679A-10.0
X-.0188Y-.7945Z.7664A-15.0
X-.0189Y-.7773Z.7649A-20.0
X-.019Y-.7601Z.7634A-25.0
G28
M2
I need to change any number immediately following an A by subtracting its absolute value from 360 and changing its sign. Any line which does not contain an A followed by a number should be pass through unchanged. The output should be:
PARTNO TEST
%
O251(TEST)
G1X-.0184Y-.8618Z.7723A-5.0F10
G8Y-.8452Z.7708A.0
X-.0185Y-.8284Z.7694A-355.0
X-.0187Y-.8115Z.7679A-350.0
X-.0188Y-.7945Z.7664A-345.0
X-.0189Y-.7773Z.7649A-340.0
X-.019Y-.7601Z.7634A-335.0
X-.0185Y-.8284Z.7694A355.0
X-.0187Y-.8115Z.7679A350.0
X-.0188Y-.7945Z.7664A345.0
X-.0189Y-.7773Z.7649A340.0
X-.019Y-.7601Z.7634A335.0
G28
M2
Note that if you convert the output file with the same program you should get back to the input file.
Thanks in advance.
Ernie
PARTNO TEST
%
O251(TEST)
G1X-.0184Y-.8618Z.7723A355.0F10
G8Y-.8452Z.7708A.0
X-.0185Y-.8284Z.7694A5.0
X-.0187Y-.8115Z.7679A10.0
X-.0188Y-.7945Z.7664A15.0
X-.0189Y-.7773Z.7649A20.0
X-.019Y-.7601Z.7634A25.0
X-.0185Y-.8284Z.7694A-5.0
X-.0187Y-.8115Z.7679A-10.0
X-.0188Y-.7945Z.7664A-15.0
X-.0189Y-.7773Z.7649A-20.0
X-.019Y-.7601Z.7634A-25.0
G28
M2
I need to change any number immediately following an A by subtracting its absolute value from 360 and changing its sign. Any line which does not contain an A followed by a number should be pass through unchanged. The output should be:
PARTNO TEST
%
O251(TEST)
G1X-.0184Y-.8618Z.7723A-5.0F10
G8Y-.8452Z.7708A.0
X-.0185Y-.8284Z.7694A-355.0
X-.0187Y-.8115Z.7679A-350.0
X-.0188Y-.7945Z.7664A-345.0
X-.0189Y-.7773Z.7649A-340.0
X-.019Y-.7601Z.7634A-335.0
X-.0185Y-.8284Z.7694A355.0
X-.0187Y-.8115Z.7679A350.0
X-.0188Y-.7945Z.7664A345.0
X-.0189Y-.7773Z.7649A340.0
X-.019Y-.7601Z.7634A335.0
G28
M2
Note that if you convert the output file with the same program you should get back to the input file.
Thanks in advance.
Ernie