SHARE
TWEET

Untitled

a guest Jun 19th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function removeDuplicates() {
  2.   var dedupeSheet = SpreadsheetApp.getActive().getSheetByName('Combined');
  3.   var data = dedupeSheet.getDataRange().getValues();
  4.   var newData = [];
  5.  
  6.   for (var i in data) {
  7.     var row = data[i];
  8.     var duplicate = false;
  9.     for (var j in newData) {
  10.       if(row[0].toLowerCase() == newData[j][0].toLowerCase() || (row[0].split(" ").length < 3)){
  11.         duplicate = true;
  12.       }
  13.     }
  14.     if (!duplicate) {
  15.       newData.push(row);
  16.     }
  17.   }
  18.   dedupeSheet.clearContents();
  19.   dedupeSheet.getRange(1, 1, newData.length, newData[0].length).setValues(newData);
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top