strip-toolchange.pl 283 B

123456789101112131415
  1. #!/usr/bin/perl -i
  2. #
  3. # Remove all toolchange commands (and T# arguments) from gcode.
  4. use strict;
  5. use warnings;
  6. # read stdin and any/all files passed as parameters one line at a time
  7. while (<>) {
  8. if (not /^T[0-9]/) {
  9. s/\s*(T[0-9])//;
  10. print;
  11. } else {
  12. }
  13. }