title: Google Apps Script extract specific columns from sheet and put into new sheet using filter & map -- slow
body: <p>Thanks in advance for your help. I'm new to apps script.</p>
  
  <p>I have a gsheet with 98 columns and 25000 rows. All I want to do is copy 24 of the 98 columns to a new sheet.</p>
  
  <p>Currently I am using filter &amp; map, and it works:</p>
  
  <p>var data = sourceSheet.getDataRange().getValues();  //read all columns &amp; rows into array</p>
  
  <p>var filterData = data.filter(function(e, j){return j > 0 &amp;&amp; e}).map(function(e){return [e[88], e[14], e[13], e[4], e[17], e[87], e[91], e[48], e[57], e[31], e[89], e[82], e[70], e[97], e[47], e[30], e[72], e[71], e[67], e[34], e[33], e[00], e[38], e[39]]});  //extract just the columns I want into a new array</p>
  
  <p>but that 2nd line takes almost an hour to execute! I presume because it is processing every element 1-by-1, even though it is just to return each one.</p>
  
  <p>I haven't tried getValue'ing and setValue'ing columns one at a time because everything I read says limit external calls and do everything in memory. And I can't imagine pushing elements 1-by-1 would be faster than filtering.</p>
  
  <p>Suggestions for faster execution?</p>