Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
¿Cómo especificar la posición de la columna al importar contenido de Gmail a una hoja de cálculo?

Al importar contenido de Gmail a una hoja de cálculo Si hay un elemento específico que se repite Este es un script de aplicación de Google donde Lastrow se agrega automáticamente.

Quiero especificar la posición de columna deseada para cada elemento.

Por favor, ayúdame.

 function myFunction() { var threads = GmailApp.search('label:extra is:unread'); var messages = GmailApp.getMessagesForThreads(threads); var sheet = SpreadsheetApp.getActive().getSheetByName('2021'); for(var i=0; i<messages.length; i++) { var plainBody = messages[i][0].getPlainBody(); var lastRow = sheet.getLastRow(); const regex=/ex0:(.*)\n(.*)ex1:(.*)\n(.*)ex2:(.*)\n/g; if(!plainBody.match(regex)) { continue; } var data = plainBody.match(regex).map(x=> { var a0 = (/ex0:(.*)/).test(x)? RegExp.$1 : '0'; var a1 = (/ex1:(.*)/).test(x)? RegExp.$1 : '0'; var a2 = (/ex2:(.*)/).test(x)? RegExp.$1 : '0'; return [a0, a1, a2]; }); sheet.getRange(lastRow+1,1,data.length,data[0].length).setValues(data); } threads.forEach(function(thread) { thread.markRead(); Utilities.sleep(100); }); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como una suposición. Suponga que sus columnas deseadas son: B, D, F. Luego intente cambiar esta línea

 sheet.getRange(lastRow+1,1,data.length,data[0].length).setValues(data);

con este:

 sheet.getRange('B' + lastRow).setValue(data[0]); sheet.getRange('D' + lastRow).setValue(data[1]); sheet.getRange('F' + lastRow).setValue(data[2]);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!