VCF (.vcf)

Background & Context

    • MIME types: text/directory, text/x-vcard
    • vCard personal data format.
    • Commonly used in email and personal information management applications and on mobile devices.
    • Standard format for electronic business cards.
    • VCF is an acronym derived from Versitcard.
    • Stores names, addresses, and other contact information.
    • Can contain multiple records.
    • Plain text format.
    • Version 3.0 is described in internet standard recommendations RFC 2425 and 2426.
    • Developed in 1995 by Apple, AT&T, IBM, and Siemens.

Import

  • Import["file.vcf"] imports a vCard as an array of rules.
  • Import["file.vcf"] gives an array of rules for each record and each data field in the file.
  • Import["file.vcf",elem] imports the specified element from a VCF file.
  • Import["file.vcf",{elem,suba,subb,}] imports a subelement.
  • Import["file.vcf",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","VCF"] or Import["file",{"VCF",elem,}].
  • See the following reference pages for full general information:
  • Importimport from a file
    CloudImportimport from a cloud object
    ImportStringimport from a string
    ImportByteArrayimport from a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Data representation elements:
  • "Data"records arranged as a table
    "Labels"labels associated with the columns of the table given by the "Data" element
    "Records"rules for each record
  • Import uses the "Records" element by default.
  • Import["file.vcf"] reads all records and returns them as a list of rules.
  • Selecting individual data fields:
  • "NamePrefix"honorific prefix part of the name
    "NameFirst"given name
    "NameMiddle"middle name or initial
    "NameLast"last name
    "Organization"organization or institution name
    "JobTitle"title or position in the organization
    "Email"email addresses
    "Phone"phone numbers
    "Fax"fax numbers
    "MobilePhone"mobile phone numbers
    "BirthDate"birthday, given as a DateList specification
    "InstantMessaging"instant messaging addresses
    "Address1"street address
    "Address2"continued street address
    "POBox"post office box number, given as a string
    "City"city name
    "ZIPCode"ZIP code
    "State"state name or abbreviation
    "Country"country name
  • Import["file.vcf","City"] returns the city name for each record as a list of strings.

Options

  • Import options:
  • "Attribute"Automaticspecifies what address type to import
    "EmptyField"Automatichow missing information is represented
  • Possible settings for "Attribute" are:
  • Allall addresses stored in the file
    Automaticselects a single address per record
    "Domestic"domestic addresses
    "Home"home addresses
    "International"international addresses
    "Postal"postal addresses
    "Shipping"shipping addresses
    "Work"work addresses
  • With the setting "EmptyField"->Automatic, no rules are returned for missing information.

Examples

Basic Examples  (1)