How to split a line on comma, ignoring commas within quotes?
<p>I have a file with many lines like so:</p>

<pre><code>1,50,"asasd",25
2,51,"apa,asdfi",26
.....
.....
</code></pre>

<p>How do I split the second line by comma skipping the comma inside the string inside the double quotes?</p>

<p>I need the result for second line as :</p>

<pre><code>[2,51,"apa,asdfi",26]
</code></pre>

<p>Currently I am trying:</p>

<pre><code>x = line.split(',')
</code></pre>

<p>The result is like :</p>

<pre><code>['2','51','"apa','asdfi"','26']
</code></pre>