Reading a list from a text file and swapping the items
<p>I have a list in a text file in this format. The list has 1000's of entries like this and this is a small sample.</p>

<pre><code>myitems =[
      ['some text, A', '12345'],
      ['place name 1', 'AAA'],
      ['some text, A', '12345'],
      ['some text', '12345'],
      ['some text CC', 'wwww'],
      ['new text', '12345'],
      ['other text, A', '12345'],
    ]
</code></pre>

<p>How do i read the list from the text file and get an output like this.</p>

<pre><code>newItems = [
  ['12345', 'some text, A'],
  ['AAA', 'place name 1'],
  ['12345', 'some text, A'],
  ['12345', 'some text'],
  ['wwww', 'some text CC'],
  ['12345', 'new text'],
  ['12345', 'other text, A'],
]
</code></pre>

<p>I am able to read from the file and manipulate it as a string but how do i get it as a list. Breaking at the comma isn't an option since individual list items might have a comma.</p>
