title: How to read quoted string from File and write it without quotes?
body: <p>I am trying to write a python script to convert rows in a file to json output, where each line contains a json blob.</p>
  
  <p>My code so far is:</p>
  
  <pre><code>with open( "/Users/me/tmp/events.txt" ) as f:
          content = f.readlines()
  
  # strip to remove newlines
  lines = [x.strip() for x in content]
  
  i = 1
  
  for line in lines:
          filename = "input" + str(i) + ".json"
          i += 1
          f = open(filename, "w")
          f.write(line)
          f.close()
  </code></pre>
  
  <p>However, I am running into an issue where if I have an entry in the file that is quoted, for example:</p>
  
  <pre><code>client:"mac"
  </code></pre>
  
  <p>This will be output as:</p>
  
  <pre><code>"client:""mac"""
  </code></pre>
  
  <p>Using a second strip on writing to file will give:</p>
  
  <pre><code>client:""mac
  </code></pre>
  
  <p>But I want to see:</p>
  
  <pre><code>client:"mac"
  </code></pre>
  
  <p>Is there any way to force Python to read text in the format ' "something" ' without appending extra quotes around it?</p>