title: Kate Text Editor regexp for CNC code alteration on PC
body: <p>When using some CAM software, the CNC code is usually generated properly with spaces.
  But for example when moved to &quot;Citizen Cincom L20&quot; machine via USB or network and edited there it lose spaces and also lose semicolons while preserving new lines which does work as semicolons anyway.</p>
  <p>But since editing of CNC program happens in 3 places: CAM Software(ESPRIT in this case), CNC machine controller and also via text editor on the computer as postprocessor in ESPRIT is garbage.I've come up with this regex</p>
  <hr />
  <pre><code>([0-9]{1,2})([A-Z])
  </code></pre>
  <hr />
  <pre><code>\1 \2
  </code></pre>
  <hr />
  <p>so</p>
  <hr />
  <pre><code>G1G99X5.4Z-.5F.12
  </code></pre>
  <hr />
  <p>Becomes</p>
  <hr />
  <pre><code>G1 G99 X5.4 Z-.5 F.12
  </code></pre>
  <hr />
  <p>that works in Kate to space everything back again for clearer reviwing of code. The only issue about it is that I need to do that manually for every file and I would like to automate it, preferably via Kate, so it would happen upon opening any ????.PRG plain text files.</p>
  <p>But I do not exactly know how such happening should be called is it like macro or what ?
  I'm looking for some suggestions to accomplish this. Or maybe some alternative solutions</p>