title: sed script for converting ascii data file?
body: <p>I used to have a way to do this, but it's been lost to time... I have one program that outputs an undeliniated ascii data file, and another program that needs the data formatted it's own way.  The output contains X,Y data points in the format: </p>
  
  <pre><code>X120207Y041009
  X120107Y040071
  etc. ...
  </code></pre>
  
  <p>where each of these ordinates represents a 2.4 data point.  The input file needs it as such:</p>
  
  <pre><code>X 12.0207 Y 04.1009
  X 12.0107 Y 04.0071
  etc. ...
  </code></pre>
  
  <p>Not all of the lines in the file are data points, but the ones that are start with "X", have the exact same format, and contain nothing else on that line.  </p>
  
  <p>All my searching for a similar conversion points toward using sed as a quick, elegant way to do this, but I never learned sed.  I think before I actually wrote a c program to do this conversion but that seems like the really hard way to recreate.  If anyone could bail me out, I'll owe you a bagel!</p>