How to Import csv-formatted Data into karatasi
This file describes the csv import using the Pearl script. For new installations we recommend to use our Java application to import csv files. Use the read item from the file menue.
We provide a Perl program to import data from csv files.
This Perl program can create a new database or add the data to an existing
General
csv means 'comma-separated values'.
In a csv file
- the data values are separated by commas
- the values may be protected by "
- double quotes in the data must be doubled.
- csv files can be easily created with the export function of a spread sheet.
Format
The import function imports the category and the data fields of a card to a
- The first column is the category name. If the category doesn't exist it is created.
- The next 6 columns are the card data.
- Empty or missing columns result in empty data fields.
- A cell may contain newlines, if it is protected by double quotes.
- Important: all strings for karatasi must be UTF-8 encoded in the csv file.
Preparation
- You need Perl
- The Perl module DBI for the database interface
- The Perl module Encode for UTF-8 support
- The Perl modules File::Basename and Time::Local.
- Download the
karatasi Tools bundle from http://sourceforge.net/projects/karatasi/files/Tools. - Setup the synchronization feature.
To do this you can either use the Java application, or install an Apache web server and use our cgi scripts for the transmission.
Do It
- unpack the downloaded tools bundle.
- change into the
tools
directory (e.g.karatasi-tools-1.5.0
) and copy your csv-encoded data file into this directory. perl import_csv.pl -h
displays usage information.perl import_csv.pl -s -d l_myFile.db myFile.csv
converts the csv file 'myFile.csv' to the karatasi database file 'l_myFile.db'.
This name with the prefix l_ and the extension *.db matches the needs of the cgi-based web server for synchronization.- Copy the database into the sync area and set the file owner to '_www'
- Finally synchronize to
karatasi on the iPhone.