title: how to split a text file and modify it in Python?
body: <p>I currently have a text file that reads like this:</p>
  
  <pre><code>101, Liberia, Monrovia, 111000, 3200000, Africa, English, Liberia Dollar;
  102, Uganda, Kampala, 236000, 34000000, Africa, English and Swahili, Ugandan Shilling;
  103, Madagascar, Antananarivo, 587000, 21000000, Africa, Magalasy and Frances, Malagasy Ariary;
  </code></pre>
  
  <p>I'm currently printing the file using this code:</p>
  
  <pre><code>with open ("base.txt",'r') as f:
     for line in f:
        words = line.split(';')
        for word in words:
           print (word)
  </code></pre>
  
  <p>What I would like to know is, how can I modify a line by using their id number (101 for example) and keep the format they have and add or remove lines based on their id number?</p>