title: cleaning JSON - removing unnecessary properties with Ruby
body: <p>I have a JSON file that is approximately 1 MB (menu.json). There are a lot of properties within it that I am hoping to remove.</p>
  
  <p>I have one text file: Strings.txt - this contains names of properties that are note needed in the JSON</p>
  
  <p>I am trying to iterate through my JSON file line by line. If a line contains a string found in strings.txt, I want to remove that line.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>tmp = File.open('clean.json', 'w')
  
  File.open('menu.json') do |json|
    File.open('strings.txt') do |x|
        tmp.puts json.each_line unless json.include? x
    end
  end
  </code></pre>
  
  <p>The result that is written to clean.json is #<code>&lt;Enumerator:0x0077ff36b04b468&gt;</code></p>
  
  <p>Could someone please tell me what I am doing wrong? This is my first Ruby script.</p>
  
  <p>Contents of <code>strings.txt</code>:</p>
  
  <pre><code>Item1
  Item2
  Item3
  </code></pre>
  
  <p>It turns out Item1, Item2 or Item3 are all being read as \\"Item1\\"</p>
  
  <p>I have to figure out why this is happening and how to handle it.</p>