kde-playground/kdepim/console/kabcclient/README.csv
2015-04-14 21:49:29 +00:00

4.3 KiB

1The CSV input and output format filters are based on KAddressBook CSV templates.
2they are quite simple structured files they can be written manually as well.
3A CSV template is basically an INI-style text file with the .desktop file
4extension.
5The file consists of three sections:
6Misc: Name of the template
7csv column map: Describes which field or column of the CSV data has
8which addressbook field.
9kabcclient finds template files in its current working directory and the
10csv-template subdirectories of KAddressBook's data locations.
11Available templates can be listed using help as the csv filters option
12#> kabcclient -if csv -if-opts help
13or
14#> kabcclient -of csv -of-opts help
15Using for example the kaddressbook template installed with KAddressBook
16would look like this
17#> kabcclient -if csv -if-opts kaddressbook
18or
19#> kabcclient -of csv -of-opts kaddressbook
20
21Example:
22--------- csvexample.desktop -------
23[General]
24Columns=3
25DatePattern=Y-M-D
26DelimiterType=0
27QuoteType=0
28[Misc]
29Name=Example CSV template
30[csv column map]
310=1
321=2
332=7
34------------------------------------
35This would transform the following input
36Quotes can be omitted if the field's value does not contain the separator
37(no comma in any of the three fields)
38Details:
39Columns=3 says that the CSV data will have three fields.
40DatePattern=Y-M-D says that dates are to be interpreted as four digit year
41separated by '-'
42Other possible letters are y (two digit year using 19 as
43d (one digit day for days < 10)
44
45DelimiterType=0 use comma as the field separator. Other possible values are:
46In case of DelimiterType=4 there is an additional entry
47DelimiterOther which has the separator character as its
48value.
49example be equivalent to DelimiterType=0
502 no quoting.
51The CSV output format filter uses the specified quote character
52on all fields.
53The column map tells the filters which columns of the CSV data maps to which
54field in the address book. Column index starts at 0.
55second column is the given name or first name and that the thrid and last columns
56is the birthday date.
57
58For full examples see the files installed along KAddressBook.
59--- field names and their csv column map values -----
60// values below currently not supported by kabcclient's filters
61-----------------------------------------