console/kabcclient
Handling of CSV (comma separated values) input/output
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
"Doe","John","2005-07-25" into an addressbook entry for a person named John Doe, having been born on July 25th, 2005Details:
Columns=3
DatePattern=Y-M-D
'-' 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
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
" as the field quoting. Other possible values are:1(use single quote')2no 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"
KDE 4.1 API Reference