Skip to content

Instantly share code, notes, and snippets.

@L4bF0x
Created August 5, 2018 16:53
Show Gist options
  • Save L4bF0x/58c8f07f082ba41eb17881d79ae75049 to your computer and use it in GitHub Desktop.
Save L4bF0x/58c8f07f082ba41eb17881d79ae75049 to your computer and use it in GitHub Desktop.
Helpful commands for parsing connect.data.com results
# Go to connect.data.com and copy and paste the contents
# of the columns into a textfile, including the phone
# image.
# Take out “Direct Dial Available” from textfile.txt
sed -Ei 's/Direct Dial Available//g' ./textfile.txt
# Grab last names
cut -d “,” -f 1 textfile.txt > lastnames.txt
cat lastnames.txt | tr -d [:blank:] > lastnames2.txt
# Grab first names
cut -d "," -f 2 textfile.txt | cut -f 1 > firstnames.txt
cat firstnames.txt | tr -d [:blank:] > firstnames2.txt
# -----------------------------
# For First letter + Lastname
# -----------------------------
# Grab first letter of each line:
cat firstnames2.txt | cut -c 1-1 > firstletter.txt
# Append two files line by line together:
paste -d “” firstletter.txt lastnames2.txt > userlist.txt
# Cleanup files
rm lastnames*.txt firstnames*.txt firstletter.txt
# -------------------------------------------
# For First Name [dot] Last Name
# -------------------------------------------
# Append for after each first name:
sed 's/\r\?$/./' firstnames2.txt > firstnamesdot.txt
# Append two files line by line together:
paste -d “” firstnamesdot.txt lastnames2.txt > userlist.txt
# Append e-mail:
sed 's/\r\?$/@confluencehealth.org/' userlist.txt
# Cleanup files
rm lastnames*.txt firstnames*.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment