• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

console/kabcclient

Handling of CSV (comma separated values) input/output

A CSV template is basically an INI-style text file with the .desktop file extension.

The file consists of three sections:

  • [General]: describes formatting options, like how dates should be interpreted or formatted, or what character is used as the field delimiter
  • [Misc]: name of the template
  • [csv column map]: describes which field or column of the CSV data has which addressbook field

Example:

[General]
Columns=3
DatePattern=Y-M-D
DelimiterType=0
QuoteType=0
[Misc]
Name=Example CSV template
[csv column map]
0=1
1=2
2=7

This would transform the following input "Doe","John","2005-07-25" into an addressbook entry for a person named John Doe, having been born on July 25th, 2005

Details:

Columns=3

Says that the CSV data will have three fields

DatePattern=Y-M-D

Says that dates are to be interpreted as four digit year followed by two digit month followed by a two digit day, separated by '-'

Other possible letters are:

  • 'y' (two digit year using 19 as the century)
  • 'm' (one digit month for months < 10)
  • 'd' (one digit day for days < 10)
DelimiterType=0

Use comma as the field separator.

Other possible values are:

  • 1 (semicolon)
  • 2 (tab)
  • 3 (single space)
  • 4 (user defined)

In case of DelimiterType=4 there is an additional entry DelimiterOther which has the separator character as its value.

DelimiterType=4 followed by DelimiterOther=, would for example be equivalent to DelimiterType=0

QuoteType=0

Use standard double quote character " as the field quoting. Other possible values are:

  • 1 (use single quote ' )
  • 2 no quoting

For full examples see the files installed along KAddressBook.

The column map tells the filters which columns of the CSV data maps to which field in the address book. Column index starts at 0

The above example template says that the first column is the family name, the second column is the given name or first name and that the thrid and last columns is the birthday date.

00 "Formatted Name"
01 "Family Name"
02 "Given Name"
03 "Additional Names"
04 "Honorific Prefixes"
05 "Honorific Suffixes"
06 "Nick Name"
07 "Birthday"
08 "Home Address Street"
09 "Home Address Locality"
10 "Home Address Region"
11 "Home Address Postal Code"
12 "Home Address Country"
13 "Home Address Label"
14 "Business Address Street"
15 "Business Address Locality"
16 "Business Address Region"
17 "Business Address Postal Code"
18 "Business Address Country"
19 "Business Address Label"
20 "Home Phone"
21 "Business Phone"
22 "Mobile Phone"
23 "Home Fax"
24 "Business Fax"
25 "Car Phone"
26 "Isdn"
27 "Pager"
28 "Email Address"
29 "Mail Client"
30 "Title"
31 "Role"
32 "Organization"
33 "Note"
34 "URL"
Values below currently not supported by CSVTemplate::setFieldText() or
CSVTemplate::fieldText()
35 "Department"
36 "Profession"
37 "Assistant's Name"
38 "Manager's Name"
39 "Spouse's Name"
40 "Office"
41 "IM Address"
42 "Anniversary"
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

console/kabcclient

Skip menu "console/kabcclient"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal