From 7e018f1d381d6b64297abb092399b2a29adf3526 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Thu, 7 Sep 2017 22:26:19 -0500 Subject: [PATCH] Added toolchange command strip for dual-on-single applications. --- utils/post-processing/strip-toolchange.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 utils/post-processing/strip-toolchange.pl diff --git a/utils/post-processing/strip-toolchange.pl b/utils/post-processing/strip-toolchange.pl new file mode 100644 index 000000000..8ed227dea --- /dev/null +++ b/utils/post-processing/strip-toolchange.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl -i +# +# Remove all toolchange commands (and T# arguments) from gcode. + +use strict; +use warnings; + +# read stdin and any/all files passed as parameters one line at a time +while (<>) { + if (not /^T[0-9]/) { + s/\s*(T[0-9])//; + print; + } else { + } +}