Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Migrate contacts from Verizon phone to iPhone' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Migrate contacts from Verizon phone to iPhone
Authored by: robleach on Jul 10, '09 12:42:33PM
Slightly Better:
\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("First Name\tMiddle Name\tLast Name\t",join("\t",keys(%$g)),"\n");foreach my $name (sort {$a cmp $b} keys(%$h)){(@names)=split(/\s+/,$name);if(scalar(@names) == 1){push(@names,("",""))}elsif(scalar(@names) == 2){@names=($names[0],"",$names1)}elsif(scalar(@names) > 3){@names=(join(" ",@names),"","")}print(join("\t",@names),"\t",join("\t",map {exists($h->{$name}->{$_}) ? $h->{$name}->{$_} : ""} keys(%$g)),"\n")}' >
This one will assign First Middle, and Last names, or if there are more than 3 names, it will put them all in the first name slot. You could tweak it more by editing the column headers on the fly so address book recognizes them better and make entries with more than 3 names a company or something, but I'm satisfied with this version. Rob

[ Reply to This | # ]