How to split delimited values in a SQLite column into multiple columns
<p>How can I parse comma separated values in <code>Fruit Basket</code> and move them to other columns. </p>

<p>For example, I want this</p>

<pre><code>Fruit Basket  Fruit1    Fruit2    Fruit3
------------  --------  --------  --------
Apple
Banana, Pear
Lemon, Peach, Apricot
</code></pre>

<p>to becomes this</p>

<pre><code>Fruit Basket  Fruit1    Fruit2    Fruit3
------------  --------  --------  --------
Apple         Apple
Banana, Pear  Banana    Pear
Lemon, Pea... Lemon     Peach      Apricot
</code></pre>

<p>If I cannot do this with a pure SQLite statement, how can I do it using Python?</p>

<p>Check the man page : </p>

<pre><code>man sqlite3 | less +/-csv
</code></pre>

<p>Then use </p>

<pre><code>sqlite ... -csv | ...
</code></pre>

<p>the output will be quit more easy to parse</p>

python sqlite