This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Google Apps Script for counting emails by sender in batches. Stopps and resumes after 5mins of processing to avoid reaching script runtime limit. | |
// 1. Allow required permissions | |
// 2. Add gmail service to project | |
// 3. Fill <your-email> in `runProcessor` function and adjust query if needed | |
// 4. Run function `runProcessor` | |
// 5. Result will be saved in a new spreadsheet | |
// Based on ideas from https://stackoverflow.com/a/59222719/5162536 and | |
// https://medium.com/geekculture/bypassing-the-maximum-script-runtime-in-google-apps-script-e510aa9ae6da |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docs = [] | |
from os import listdir, chdir | |
import re | |
# Here's the section where I try to filter useless stuff out. | |
# Notice near the end all of the regex patterns where I've called | |
# "re.DOTALL". This is pretty key here. What it means is that the | |
# .+ I have referenced within the regex pattern should be able to | |
# pick up alphanumeric characters, in addition to newline characters |