rubo77
rubo77

Reputation: 20845

Import CSV contacts into Android 4 phone

I have a CSV-file with all my contacts (exported from Thunderbird).

On my Phone I have Android 4 ice cream sandwich installed.

How can I import the contacts from the CSV-File into my Android cellphone (sony ericson Xperia Ray) without using any "spyware" (google, facebook, outlook, etc.)?

Upvotes: 5

Views: 37405

Answers (5)

Andrew
Andrew

Reputation: 1

Okay so I'm on Android 7.0 but here's how I had to do it from my phone... I was importing from my old phone, a Windows Phone 8, and I think it could only export my contacts to CSV...

(Fortunately that's a universal file extension (Comma Separated Values), and I was also able to remove some junk manually with regex - anyways...)


Using either Firefox Beta or Google Chrome, I went to http://google.com/contacts, logged into the GMail account I wanted use for my phone's contacts, in Firefox Beta I had to tell it to use the old version of Contacts I think (the new version didn't have an import feature), and then the page looked like the standard web GMail layout kind of. On the left side was a link that said "Import Contacts...", so I clicked that, and then it let me choose a file from my phone ("Documents"); note that this part did not work in Firefox Focus.

At the top right I selected "Show internal storage", and then at the top left I opened up File Manager, selected my CSV file, and imported it into GMail Contacts. Then, it immediately synced all of the contacts over to my Android phone.

Upvotes: 1

user3125766
user3125766

Reputation: 11

An easy way to export all contacts in outlook as vcf is to select them all and choose email as attachments. Once the draft emails opens up with attachments, select all attachments, right click and copy. Got to a folder, right click and paste.

Upvotes: 1

UnX
UnX

Reputation: 451

This is a dirty fix but it worked for me (on Linux although cygwin could be used on Windows env) :

  1. Export your contact in Thunderbird as CSV using commas.
  2. File format is like this :

First Name,Last Name,Display Name,Nickname,Primary Email,Secondary Email,Screen Name,Work Phone,Home Phone,Fax Number,Pager Number,Mobile Number,Home Address,Home Address 2,Home City,Home County,Home Post Code,Home Country,Work Address,Work Address 2,Work City,Work County,Work Post Code,Work Country,Job Title,Department,Organisation,Web Page 1,Web Page 2,Birth Year,Birth Month,Birth Day,Custom 1,Custom 2,Custom 3,Custom 4,Notes,

In my case most the entries contain only First Name,Last Name,Display Name,,Primary Email.

So I used sed to convert each entry to VCF 2.1 format :

BEGIN:VCARD
VERSION:2.1
N:LastName;FirstName
FN:FirstName LastName
EMAIL;PREF;INTERNET:local@domain
END:VCARD

Here is the script ( honestly it is just a one line command but for more clarity.. ) :

#!/bin/bash

# This script convert a ThunderBird AddressBook ( 17.04) exported as CSV file using commas into a VCF 2.1 file.
# rmistero - April 2013 - GNU GPL 3


CSV_FILE="contacts.csv"
VCF_FILE="contacts.vcf"

# sed is looking for regex pattern NOT containing commas between 2 commas.

sed -e "s/^\([^,]*\|\".*\"\),\([^,]*\),\([^,]*\),[^,]*,\([^,\"\']*\),.*$/N:\2;\1\nFN:\3\nEMAIL;PREF;INTERNET:\4\n/g" -e "1d" < $CSV_FILE |  sed -e "/^EMAIL/ a\END:VCARD" -e "/^N/ i\BEGIN:VCARD\nVERSION:2.1" | grep -vE "^$|\"" > $VCF_FILE

Once the file has been converted, just put the file on the USB drive of your Android phone. Then go to Contact, Settings, and Import/Export a single vCard file.

If everything goes well you should see the number of contact entries detected by the phone and the number loaded to the phone.

NOTE: to count the number of entries in contacts.csv, just do :

grep -c EMAIL contacts.csv

This will return the number of lines matching "EMAIL" ( hence number of contacts).

Upvotes: 4

Jon
Jon

Reputation: 1142

Here's the Windows-only version of rubo77's solution:

  1. Import the csv-list into the Windows 7 Contacts. (remember you can only use the Windows contacts fields once per csv field)

  2. Export the Windows Contacts into single VCF-Cards.

  3. Glue them all together into one large vcf file:

    type *.vcf>..\all_adresses.vcf

  4. Convert all_adresses.vcf to UTF-8 so the special characters are correct:

    Open all_adresses.vcf in Notepad++, click Encoding > Encode in UTF-8. Save.

  5. Import them into android Phone (in Contacts there is an option to import from SD-Card)

Upvotes: 5

rubo77
rubo77

Reputation: 20845

I tried a lot and finnally i found a solution that works without google!

  1. I imported my csv-list into the Windows 7 Contacts. (it's easy if you adjust the first line with the correct fieldnames)

  2. then I exported them from there into single VCF-Cards.

  3. I glued them all together into one large vcf file:

    cat *.vcf>../all_adresses.vcf

  4. convert them to UTF-8 so the special characters are correct:

    iconv --from-code=ISO-8859-1 --to-code=UTF-8 all_adresses.vcf > all_adresses_correct.vcf

  5. finally I imported them in my android Phone (in Contacts there is an option to import from SD-Card)

if you delete them from your windows contacts after you are done, I think no traces of your addresses are left on the computer.

Upvotes: 5

Related Questions