Skip to content

Instantly share code, notes, and snippets.

@shang-lin
Created November 24, 2015 18:52
Show Gist options
  • Save shang-lin/2d0d20cb6e5d392288a9 to your computer and use it in GitHub Desktop.
Save shang-lin/2d0d20cb6e5d392288a9 to your computer and use it in GitHub Desktop.
Construct a comma-separated email list that can be copied and pasted into the to, cc, or bcc field.
# myfile.csv is a CSV export of a Google sheet. that contains name, email, and affiliation .
# The first three lines are headings and boilerplate. "-n +4" tells tail to only display line 4 and later.
# The cut command extracts the second column (email addresses) using ',' as the delimiter.
# tr transforms the newlines into commas to create a comma-separated list of only email addresses.
tail -n +4 myfile.csv | cut -d ',' -f 2 | tr '\n' ','
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment