How can I work data magic to find hundreds of phone numbers fast?
March 18, 2008 12:38 AM
Subscribe
How can I work some data magic and save time looking up hundreds of phone numbers with data from an Excel spreadsheet?
I have a few hundred names and addresses of people to whom I must now attach phone numbers. The obvious route is to open the spreadsheet in one window, and a phone directory in another, and manually type in all the relevant info and search over and over again. But this would be extremely tedious.
I've considered teaching myself how to use some macro program to streamline the process so that I could automatically cut and paste fields from the spreadsheet into the browser and search. However, I'm not sure what program I'd use and what would be the quickest way to teach myself how to use it. I was considering AutoHotKey, but I'd welcome other suggestions.
I was also wondering if there are any sites or software with open databases of phone numbers. And could I use something like Yahoo Pipes to feed the data from one place to another?
I know how creative and helpful you MeFites can be, so I'm looking forward to what you can think up.
Thanks!
posted by abkadefgee to computers & internet (6 comments total)
For example, let's say you have two delimited text files exported from Excel, called
addressbook.txtandphonebook.txt:addressbook.txtLast name | First name | Street | City | State | Zip...phonebook.txtLast name | First name | Phone...You could have a script like the following:
#!/bin/bash
if [ -f newaddressbook.txt ]
then
rm newaddressbook.txt
fi
old_IFS=$IFS
IFS=$'\n'
cat addressbook.txt | while read line
do
searchString=`echo ${line} | cut -d'|' -f1,2`
cat phonebook.txt | while read listing
do
targetString=`echo ${listing} | cut -d'|' -f1,2`
if [ "$searchString" = "$targetString" ]
then
phonenumber=`echo ${listing} | cut -d'|' -f3`
echo "${line} |${phonenumber}" >> newaddressbook.txt
fi
done
done
IFS=$old_IFS
You'll get a new file called
newaddressbook.txtwhich joins the address with the phone number:Last name | First name | Street | City | State | Zip | Phoneposted by Blazecock Pileon at 2:27 AM on March 18, 2008