Last active
August 20, 2018 06:22
-
-
Save packeted/462d7f8da1968f850de0284ba1e0be5e to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Usage: ./hashscript <input> <output> | |
# Open terminal in Mac, type "nano hashscript", paste this in and save. Type "chmod +x hashscript" and make sure your data files are in the same directory | |
# Data format, rows of: example@domain.com,a,b,c,d,e where the first field is what you want to hash | |
for i in `cat $1`; do | |
IDENTIFIERFIELD="`echo $i | cut -d, -f 1 | tr -d ' ' | tr '[A-Z]' '[a-z]'`" | |
RESTOFINFO="`echo $i | cut -d, -f2-`" | |
IDENTIFIERFIELDHASH="`echo $IDENTIFIERFIELD | md5`" | |
echo $IDENTIFIERFIELDHASH,$RESTOFINFO >> $2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment