Convert address book to a Card file compatible with Android phones.
Post ReplyConvert address book to a Card file compatible with Android phones.Posted: Friday, February 16, 2018 [04:41:14] - 1
Bought me an Android phone and being lazy person I searched the Internet for info on how to convert my contacts to a format that would be compatible with Android phone. Most, if not all my data stored in plain text format as it is the most useful when it comes to converting. Data includes type of the contact phone for a given contact name, i.e. Cellphone, Work, Home etc. So it is first converted to a multi-level hash and written to a VCard: # .. create a hash while reading the input data (omitted) .. foreach $name (sort keys (%byname)) { $out .= "BEGIN:VCARD\nVERSION:3.0\n"; $out .= "FN:$name\n"; # List phones by type foreach $phone (sort keys %{$byname{$name}}) { $type=$byname{$name}{$phone}; $out .= "TEL;type=$type:$phone\n"; } ## FOREACH PHONE END # Place the end statement on the vCard $out .= "END:VCARD\n"; } ## FOREACH NAME END open(VCD,">/save_to_folder/addresses.vcf"); print VCD $out; close(VCD); Unless there are a few millions of records, I did not feel like installing and using Perl modules. |
RE: Convert address book to a Card file compatible with Android phones.Posted: Sunday, February 18, 2018 [18:28:11] - 2
Another idea came to mind and it works if file is saved (or copied after being saved) to a local Mac's webserver, accessible on LAN so it can be downloaded to your phone. Add this line to your script: By entering LAN's address, i.e. http://YourMac.local/addresses.vcf where YourMac.local is your Mac's address on LAN - file will be automatically downloaded to your phone and contacts updated with new information. |