---
name: "hk_importcsv"
section: "1"
platform: "linux"
package: "libhk-classes-dev"
version: "0.8.3-4"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/hk_importcsv"
---

# hk\_importcsv(1)

imports a csv file. hk\_importcsv is part of the hk\_classes package

## NAME

hk\_importcsv - imports a csv file. hk\_importcsv is part of the hk\_classes package

## SYNOPSIS

**hk\_importcsv -d driver -b database -t tablename \[OPTIONS\] CSV-file**

## DESCRIPTION

**hk\_importcsv** imports a csv file and creates the table if necessary.

## OPTIONS

- \-b, --database=DATABASE

  database name

- \--between=BETWEEN

  column separator, default is ','

- \-d, --driver=DRIVERNAME

  set the SQL-driver (e.g. mysql). You can get a list of all existing SQL-drivers with **-l** or **--list**

- \--delimiter=TEXTDELIMITER

  the text delimiter, default is '"'

- \--df=dateformat

  date format, may contain M D Y, example: D.M.Y

- \--tf=timeformat

  time format, may contain h m s , example: h:m:s

- \--dtf=datetimeformat

  datetime format, may contain M D Y h m s, example: D.M.Y h:m:s

- \--locale=locale

  locale of the import file, influences the number appearance

- \--charset=charset

  charset of the import file

- \--noautoincdetection

  avoids detection of auto\_inc data type

- \-f, --filter=FILTER

  filter of the datasource. It has the same syntax as the WHERE clause of a SQL statement, just without the 'WHERE'. **Example:** "author\_id = 5"

- \-h, --host=HOST

  name  or IP-number of the host

- \-l, --list

  List available database drivers

- \--noheader

  if set the column names will not be included in the first row

- \-p, --password=PASSWORD

  user password at the SQL server

- \-r, --port=PORT

  TCP-port on host

- \-t, --table=TABLE NAME

  the name of the table

- \-u, --user=USERNAME

  user name at the sql-server

- \-w, --overwrite

  overwrites the table if it already exists

- \--version

  version and author of hk\_classes

## DIAGNOSTICS

hk\_importcsv returns 0 if everything was ok, or 1 if an error occured. A clear text error message will be written to stderr.

## AUTHOR

Horst Knorr \<hk\_classes@knoda.org\>

## SEE ALSO

[**hk\_exportcsv**(1)](/hk_exportcsv/1.md), [**hk\_exportxml**(1)](/hk_exportxml/1.md), [**hk\_importcsv**(1)](/hk_importcsv/1.md)
