|
|
|
Migrate contacts from Verizon phone to iPhone
OK. I have worked it out. This command line grep and perl script will convert the html file to a tab delimited file in one shot. Note that it Verizon ever changes their HTML code, this will no longer work correctly. This will output headers on the first line:
grep -E "name more|Mobile|Work|Home|Fax|mailto" vzaddressbookbackup20090710.html | perl -e 'while(<>){if(/^.*name more[^>]+>([^<]+)/){$name=$1}elsif(m%>([^<]+)</strong>(?:<a[^>]+>)?([^<]+)%){$g->{$1}=1;$h->{$name}->{$1}=$2}}print("Namet",join("t",keys(%$g)),"n");foreach my $name (sort {$a cmp $b} keys(%$h)){print("$namet",join("t",map {exists($h->{$name}->{$_}) ? $h->{$name}->{$_} : ""} keys(%$g)),"n")}' > vzaddressbookbackup20090710.tab
Note, you will have to put your input and output file names where bolded.
Rob
|
SearchFrom our Sponsor...Latest Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2013 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.05 seconds |
|