Created
August 5, 2018 16:53
-
-
Save L4bF0x/58c8f07f082ba41eb17881d79ae75049 to your computer and use it in GitHub Desktop.
Helpful commands for parsing connect.data.com results
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
# 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