How to convert SQL entry into specific form in python given an input file of multiple SQL entries?
<p>Let's say we have a text file containing a SQL entry on each line formatted as follows:</p>

<pre><code>INSERT INTO TABLE1(NUM, TIMESTAMP) VALUES ('0', '2016-04-26 15:38:07')
</code></pre>

<p>Is there a way to format this into the format below using a Python script?</p>

<pre><code>[(26 Apr 2016 15:38:07)|0]
</code></pre>

<p>The number <code>NUM</code> can be multiple digits so this can't be done just using hard coded indices.</p>

<p>So, given a text file <code>input.txt</code>, how would you convert each line into the new format and save it as <code>output.txt</code>?</p>