split cell to rows by pipe python
<p>I am trying to split a cell into 2 rows by pipe ("|").</p>

<p>For instance:</p>

<pre><code>ID  Site    Category    Queries

1   0        38037      antique+wall+telephone|antique+wall+phone
</code></pre>

<p>will become:</p>

<pre><code>ID  Site    Category    Queries

1   0         38037     antique+wall+telephone

1   0         38037     antique+wall+phone
</code></pre>

<p>Here's one way:</p>

<pre><code>&gt;&gt;&gt; id, site, category, queries
('1', '0', '38037', 'antique+wall+telephone|antique+wall+phone')
&gt;&gt;&gt; for query in queries.split('|'):
...     print id, site, category, query
... 
1 0 38037 antique+wall+telephone
1 0 38037 antique+wall+phone
</code></pre>

python