title: Add specific string to the end of specific lines from files
body: <p>So right now I have:</p>
  
  <pre><code>1,A
  2,B
  3,C
  </code></pre>
  
  <p>How do I use python to write to the file and make it:</p>
  
  <pre><code>1,A,some_string1
  2,B,some_string2
  3,C,some_string3
  </code></pre>
  
  <p>All I found was a solution to add the same string to every line like this:</p>
  
  <pre><code>1,A,abc
  2,B,abc
  3,C,abc
  </code></pre>
  
  <p>Using:</p>
  
  <pre><code>file_name = "thing"
  string_to_add = "abc"
  
  with open('thing', 'r') as f:
      file_lines = [''.join([x.strip(), string_to_add, '\n']) for x in   f.readlines()]
  
  with open('thing', 'w') as f:
      f.writelines(file_lines) 
  </code></pre>