I need to edit gcode for a model in particular I have to substract number 87 from all Z coordinates. Here is sample of gcode:
;LAYER:435
G0 F9000 X-38.420 Y-26.887 Z87.300
;TYPE:WALL-INNER
G1 F1800 X-37.709 Y-27.459 E1386.91774
G1 X-37.020 Y-28.062 E1386.94819
G1 X-36.404 Y-28.635 E1386.97618
From previous sample there is Z87.300 , which I need change to Z0.300 and do this for entire Z. I have tried following command in vim:
:%s/Z\(\d\d\)/\="Z".submatch(1)-87/
But it acts wrong.