How can I not read the last line of a csv file if it has simply 1 column in Python?
<p>I have 2 csv files with 4 columns like these.</p>

<pre><code>1 3 6 8\n                 1 3 7 2\n
7 9 1 3\n                 9 2 4 1\n
\n                        1 8 2 3\n
</code></pre>

<p>I only want to read rows with at least 2 columns because the row with only  \n, it isnÂ´t useful.</p>

<p>Currently, I am reading files using this:</p>

<pre><code>for line in f:
        list = line.strip("\n").split(",")
        ...
</code></pre>

<p>But, I want that lines with only 1 column should be ignored.</p>

<p>You can just quit the loop when you hit the blank line.</p>

<pre><code>if not line.strip():
    break
</code></pre>

python python-2.7 csv readfile