title: Using Python and Json and trying to replace sections
body: <p>I'm using python to try and locate and change different parts of a Json file.</p>
  
  <p>I have a list with 2 columns and what I want to do is look for the string in the first column, find it in the Json file and then replace it with the second column in the list.</p>
  
  <p>Does anyone have any idea how to do this? Been driving me mad.</p>
  
  <pre><code>for row in new_list:
      if json_str == new_list[row][0]:
          json_str.replace(new_list[row][0], new_list[row][1])
  </code></pre>
  
  <p>I tried using the .replace() above but it says that it list indices must be integers or slices, not list.</p>
  
  <p>The way that I've managed to print off all the data works...   </p>
  
  <p>But this is not referencing anything, so if anyone has any ideas, feel free to lend a hand, thanks.</p>
  
  <pre><code>import json
  
  # I import a json file and a text file...
  
  # with open('json file', 'r', encoding="utf8") as jsonData:
  #    data = json.load(jsonData)
  #    jsonData.close()
  
  jsonData = {"employees":[
      {"firstName":"a"},
      {"firstName":"b"},
      {"firstName":"c"}
  ]} 
  
  # text_file = open('text file', 'r', encoding="utf8")
  # list = text_file.readlines()
  # jsonString = str(data)
  
  # The text file contains lots of data like 'a|A', 'b|B, 'c|C'
  # so column 1 is lower and column 2 is upper
  
  list = 'a|A, b|B, c|C'
  
  def print_all():   
      for value in list:
          new_list = value.split("|")
          print("%s" % value.split("|"))
          # This prints column 1 and 2
  
          if new_list[0:] == 'some value':
              print(new_list[1])
              # This prints off the 'replaced' value 
  
  print_all()
  </code></pre>
  
  <p>edit for the comment, this should be able to run... I think</p>