csv import

Support requests, bug reports, questions etc.

csv import

Postby kmoller » Fri Mar 23, 2012 10:38


I need help!! I am trying import from a csv file!!

cvs file :


i do, and get :

./add_items_from_csv.pl -c hosts -f tmp.csv -s -x5

[ Initializing NConf perl-API (library version 0.3, written by A. Gargiulo) ]
[ Copyright (c) 2006 - 2012 Sunrise Communications AG, Zurich, Switzerland ]

[TRACE] |NConf::DB::setDbReadonly| Entered setDbReadonly()
[DEBUG] |NConf::DB::setDbReadonly| Setting DB read-only to 1
[INFO] |NConf::DB::setDbReadonly| Running in simulation mode. No modifications will be made to the database!
[INFO] Started executing ./add_items_from_csv2.pl
[TRACE] |NConf::ImportCsv::parseCsv| Entered parseCsv()
[TRACE] |NConf::ImportCsv::parseCsv| Parameters - File: tmp2.cvs, Class: hosts, CSV_delim: ;
[TRACE] |NConf::ImportCsv::parseCsv| Parameters - csv_delim: ;
[TRACE] |NConf::ImportCsv::parseCsv| Looking for CSV syntax in file header
[ERROR] |NConf::ImportCsv::parseCsv| CSV syntax not found in file header. Aborting.

anybody ?

Re: csv import

Postby Tontonitch » Fri Mar 23, 2012 16:43

Your first line in the csv file, specifying the CSV format, is not well formatted.
Your file should be:

You may also remove the ";" at the end of each line, but it should also work with.

Also, your command is wrong (host and not hosts for the class type). It should be:
Code: Select all
./add_items_from_csv.pl -c host -f tmp.csv -s -x5

User avatar
NConf addict
NConf addict
Posts: 254
Joined: Fri May 07, 2010 10:14
Location: Thionville, France

Re: csv import

Postby kmoller » Fri Mar 23, 2012 18:05

hi Yannick

it works

merci :)

Br kenneth

Return to Support (NConf 1.3.0)

Who is online

Users browsing this forum: No registered users and 2 guests