Ivor O’Connor

May 18, 2012

Combining google voice address book with customer records making a master address book

Filed under: Uncategorized — ioconnor @ 8:03 pm

Parsing files from the command line today for a phone application.

grep -o '[0-9]\{3\}-[0-9]\{3\}-[0-9]\{4\}' customer*.* | sed 's/customer_//' | sed 's/.shtml:/ /' | sed 's/.php:/ /' | sed 's/.html:/ /' | sed 's/\(.*\) \(............\)/printf "+1\2 jb%04d\n" \1/' | sed -e 's/-//g' > /tmp/blah1
. /tmp/blah1 > /tmp/blah2

Leaves the customer phone number followed by their job number ready to be fed into the telephone database. Need to combine it with the google voice phone book though. So after exporting gv to contacts.csv…

grep “[0-9]\{6,12\}” contacts.csv | sed -e ‘s/Normal//’ | sed -e ‘s/My Contacts//’ | sed -e ‘s/DO NOT PICKUP;//’ | sed -e ‘s/;IgnoreTheseNumbers//’ | sed -e ‘s/Coworkers//’ | sed -e ‘s/;//g’ | sed -e ‘s/,,//g’ | sed -e ‘s/”Mobile Phone://’ | grep -e “+[0-9]\{5,20\}” | sed -e ‘s/\(.*\)\(+[0-9]*\)/\2: \1/’ | sed -e ‘s/,/ /g’ > /tmp/txt
and once inside /tmp/txt
:%s/\(+\d*: \)\(.*\)\(\n+\d*: \)\(“\)/\1\2\3\2/g
:%s/\(+\d*: \)\(.*\)\(\n+\d*: \)\(Mobile Phone:\)/\1\2\3\2/g
To get description on those lines that don’t have it

Then combine the files, put a comma at the end of each number and do:

sort -u -t, -k1,1 files > final

Advertisements

May 13, 2012

Writing Style

Filed under: Uncategorized — ioconnor @ 3:28 pm

I found this interesting PDF while trying to find a new website to check my grammar and writing style:

http://www.impact-information.com/Resources/working.pdf

It looks potentially engaging. As in maybe more fun to read than watching a movie…

Remove Duplicate Lines In File And Keep Order

Filed under: Uncategorized — ioconnor @ 3:12 pm

awk ‘ !x[$0]++’ file3

I found this at http://unstableme.blogspot.com/2008/03/remove-duplicates-without-sorting-file.html and don’t understand how it works. I’ve needed this from time-to-time though and don’t want to search for it again.

 

May 2, 2012

Facebook Bad. Google+ Good!

Filed under: Uncategorized — ioconnor @ 4:27 pm

I’ve been spring cleaning. Working hard on reducing the emails by 50 each and every day. I doubt I’ll ever get down to zero but I’m trying. Yesterday I didn’t get around to it so today I’m doing 100 and it was giving me problems. However I struck upon an easy way to do it. Search for the term “facebook”. Any emails with that term can probably be deleted as an advertisement of some sort!

 

Create a free website or blog at WordPress.com.