Skip to content

Instantly share code, notes, and snippets.

@stucka
Created May 3, 2016 19:15
Show Gist options
  • Save stucka/dd296cdab56e74b3db019fbf40ab9264 to your computer and use it in GitHub Desktop.
Save stucka/dd296cdab56e74b3db019fbf40ab9264 to your computer and use it in GitHub Desktop.
Slugifyish thingy for Excel and Python
=substitute(substitute(substitute(substitute(lower(B2) & "-" & lower(A2) & text(C2, "mmddyyyy"), " ", "-"), "’", ""), "'", ""),".", "") & ".jpg"
photofilename = (row['First name'] + "-" + row['Last name']).lower()
photofilename = photofilename + datetime.datetime.strftime(datetime.datetime.strptime(row['Date'], "%m-%d-%Y"), "%m%d%Y")
photofilename = photofilename.replace(" ", "-").replace("'", "").replace('"', '').replace("’", "").replace(".", "")
photofilename = photofilename + ".jpg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment