I've gone as far as I can with Vectric Cut2D customizing a post processor in order to adapt a CNC Plasma Cutting System to a CNC Router cutter. Due to compatibilities issues between those two applications I need to correct the output from the post processor beyond what I can customize within Vectric Cut2D itself. I was hoping someone here might be able to help me generate a C++ program that would edit the text files to generate the G-code in the format I need.
I am hoping to write a C++ file that I can import the g-code text, and it will remove any instances of a empty "G1" "G22" when they are not followed immediately by any other text . I also need the program to insert a "G24" directly before any stand alone Z command such as "Z-.5000" Otherwise I need it to ignore the otherwise inoffensive text and output a new text file or overwrite the original Please see below, "Before" being the original post and "After" having been revised manually to read as desired.