Skip to content

Instantly share code, notes, and snippets.

@adamlacombe
Last active December 18, 2020 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamlacombe/dd6b4de41f552e543f2fa293fdc3fede to your computer and use it in GitHub Desktop.
Save adamlacombe/dd6b4de41f552e543f2fa293fdc3fede to your computer and use it in GitHub Desktop.
Transform invite csv - capitalize name columns and lowercase emails
`First Name,Last Name,Email
john,doe,John.Doe@example.com
bobby,joe,Bobby.Joe@example.com`
.split('\n')
.map(r => r
.split(',')
.map((c, cIndex) => (cIndex === 2)
? c.toLowerCase()
: c.charAt(0).toUpperCase() + c.slice(1).toLowerCase())
.join(","))
.join('\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment