Read Textfile Write new CSV file
<p>Currently I have the following code which prints my desired lines from a .KAP file.</p>

<pre><code>f = open('120301.KAP')
for line in f:
    if line.startswith('PLY'):
       print line
</code></pre>

<p>This results in the following output</p>

<pre><code>PLY/1,48.107478621032,-69.733975000000

PLY/2,48.163516399836,-70.032838888053

PLY/3,48.270000002883,-70.032838888053

PLY/4,48.270000002883,-69.712824977522

PLY/5,48.192379262383,-69.711801581207

PLY/6,48.191666671083,-69.532840015422

PLY/7,48.033358898628,-69.532840015422

PLY/8,48.033359033880,-69.733975000000

PLY/9,48.107478621032,-69.733975000000
</code></pre>

<p>My goal is not to have it just print these lines. I'd like to have a CSV file created named 120301.csv with the coordinates in there own columns (leaving the PLY/# behind). Simple enough? I've been trying different import CSV functions for awhile now. I can't seem to get anywhere.</p>