title: Converting string file into json format file
body: <p>Ok , let say that I have a string text file named "string.txt" , and I want to convert it into a json text file.
  What I suppose to do? I have tried to use 'json.loads()' ,but it never works with me!
  here is a part from my text file :</p>
  
  <pre><code>rdian","id":"161428670566653"},{"category":"Retail and consumer merchandise","category_list":[{"id":"187937741228885","name":"Electronics Store"},{"id":"191969860827280","name":"Photographic Services &amp; Equipment"}
  </code></pre>
  
  <p>any help please?
  edit:
  I have use this code:</p>
  
  <pre><code>import json
  
  f = open("string.txt", 'w')
  f1 = open("stringJson.txt", 'r')
  
  
  f.write(json.dumps(json.loads(f), indent=1))
  
  
  f.close()
  </code></pre>
  
  <p>the  error is like this:</p>
  
  <p>obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  TypeError: expected string or buffer</p>
  
  <p><img src="https://i.stack.imgur.com/JaEMF.png" alt="enter image description here"></p>