title: I am writing into a csv file but when i open it nothing is there
body: <p>Initially I have am empty csv file on my computer. I start with this piece of code:</p>
  
  <pre><code>     CSV.open("GreenTea.csv", "wb") do |csv|
        csv &lt;&lt; ["ObjectID", "PropertyID", "PropertyValue", "SourceID"]
      end 
  </code></pre>
  
  <p>This does its job right and writes this into the file. Later on I made a struct and would like to convert it into csv so I did this:</p>
  
  <pre><code>....
  
    current = info.new
    current.ObjectID = text[0] #Green tea
    current.PropertyID = nil #Relation
    current.PropertyValue = text[1] #description of antioxidant
    current.SourceID = a['href'] #source extracted by clubweb
  
    CSV.open("GreenTea.csv", "wb") do |csv|
          csv &lt;&lt; [current.ObjectID, current.PropertyID, current.PropertyValue, current.SourceID]
      end 
  end
  </code></pre>
  
  <p>However when I check the file again, I only see this:
  <img src="https://i.stack.imgur.com/ZuQbr.png" alt="enter image description here"></p>
  
  <p>It seems like the info is being overwritten by the very last info in the loop!
  How can i prevent this? i want to keep adding into the file not overwrite.</p>