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