title: Python CSV read-> write; remove and replace PLUS: end of line is JSON format
body: <p>I am having problems getting my Python script to do what I want.  It does not appear to be modifying my file.</p>
  
  <p>I want to:</p>
  
  <ol>
  <li>Read in a *.csv file that has the following format
  PropertyName::PropertyValue,…,PropertyName::PropertyValue,{ExtPropertyName::ExtPropertyValue},…,{ExtPropertyName:: ExtPropertyValue}</li>
  <li>I want to remove PropertyName:: and leave behid just a column of the PropertyValue</li>
  <li>I want to add a header line</li>
  </ol>
  
  <p>I was trying to step through replacing the :: values with a comma, but cant seem to get this to work:</p>
  
  <pre><code>fin = csv.reader(open('infile', 'rb'), delimiter=',')
  fout = open('outfile', 'w')
  for row in fin:
     fout.write(','.join(','.join(item.split()) for item in row) + '::')
  fout.close()
  </code></pre>
  
  <p>Any advice, whether on my first step problem, or to a bigger picture resolution is always appreciated. Thanks.</p>
  
  <p>UPDATE/EDIT asked for by a person nice enough to review for me!</p>
  
  <p>Here is the first line of the *.csv file (INPUT)</p>
  
  <pre><code>InnerDiameterOrWidth::0.1,InnerHeight::0.1,Length2dCenterToCenter::44.6743867864386,Length3dCenterToCenter::44.6768028159989,Length2dToInsideEdge::44.2678260053526,Length3dToInsideEdge::44.2717800813466,Length2dToOutsideEdge::44.6743867864386,Length3dToOutsideEdge::44.6768028159989,MinimumCover::0,MaximumCover::0,StartConnection::ImmxGisUtilityNetworkCommon.Connection,
  </code></pre>
  
  <p>In a perfect world here is what I would like my text file to look like (OUTPUT)</p>
  
  <pre><code>InnerDiameterOrWidth, InnerHeight, Length2dCenterToCenter,,,,,,,,,,,
  0.1,0.1,44.6743867864386
  </code></pre>
  
  <p>so one header line and the values in column</p>
  
  <p><strong>UPDATED</strong> JSON Info</p>
  
  <p>The end of each line has JSON formatted text:</p>
  
  <pre><code>{StartPoint::7858.35924983374[%2C]1703.69341358077[%2C]-3.075},{EndPoint::7822.85045874375[%2C]1730.80294308742[%2C]-3.53962362760298}
  </code></pre>
  
  <p>WHich I need to split into X Y Z and X Y Z with headers</p>