Android VCF Import

From Cactus Howto
Revision as of 19:59, 8 June 2014 by Tim (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Problem: Android kann keine vcf-Dateien importieren, die mehr als einen Kontakt enthalten (Fehlermeldung: Importieren der vCard nicht möglich

1. Schritt: vcf-Datei "Kontakte-alle.vcf" mit allen Kontakten erzeugen (z.B. aus google heraus oder auch aus den Macos-Kontakten).

Folgendes Perl-Script zerhackt eine vcf-Datei mit mehreren Kontakten in einzelne vcf-Dateien:

#!/usr/bin/perl -w
use strict;
use warnings;
my $contact_no = 0;
my $vcf = '';
my $line;
while (defined($_ = <ARGV>)) {
        $line = $_;
        $vcf .= $line;
        if ($line =~ /END\:VCARD/) {
                open (OUT, ">contact_$contact_no.vcf") || die "contact_$contact_no.vcf konnte nicht geschrieben werden.\n";
                print OUT $vcf;
                close (OUT);
                $contact_no++;
                $vcf = '';
        }
}

Aufruf mit:

./vcf-seperator.pl Kontakte-alle.vcf

Einzeldateien zusammenpacken

tar cvfz contacts.tgz contact_*

und auf android kopieren (geht auch auf anderem Wege, aber per Mail kann man aus Sicherheitsgründen einen Anhang mit tgz-Endung nicht abspeichern):

scp contacts.tgz android:

Auf android Telefon in shell tgz-Datei entpacken:

tar xvfz contacts.tgz

Kontakte App starten und dort Option - Importieren/Exportieren - Aus Speicher importieren - Konto auswählen (in meinem Fall Exchange) - Alle vCard-Dateien importieren