title: Google Spreadsheet find duplicates and delete ALL
body: <p>I have a spreadsheet with duplicates rows. All the duplicate rows needs to be deleted.</p>
  
  <p>Example:</p>
  
  <pre><code>Superman    superhero
  Batman      superhero
  Apple       fruit
  Superman    superhero
  Batman      superhero
  </code></pre>
  
  <p>after running the script I only want:</p>
  
  <pre><code>Apple       fruit
  </code></pre>
  
  <p>Found this script... maybe a good point to start?</p>
  
  <pre><code>function removeDuplicateRows() {
    var sheet = SpreadsheetApp.getActiveSheet();
    var data = sheet.getDataRange().getValues();
    var newData = new Array();
  
    for(i in data){
      var row = data[i];
      var duplicate = false;
  
      for(j in newData){
        if(row.join() == newData[j].join()){
          duplicate = true;
        }
      }
      if(!duplicate){
        newData.push(row);
      }
    }
    sheet.clearContents();
    sheet.getRange(1, 1, newData.length, newData[0].length).setValues(newData);
  }
  </code></pre>