I am trying to load a CSV file into spiceworks. I have followed the how-to post.

My test CSV file contains:


Name,Manufacturer,Device Type,Model,IP Address,Serial Number,Location,Operating System
copier1,Apple,Copier,test,192.168.168.115,test,Austin,test
fax1,Acme,Fax,Latitude D830,test,45322221,Round Rock,Fax Plus Bios
fax2,Acme,Fax,Latitude D830,test,45322222,Cedar Park,Fax Plus Bios
fax3,Acme,Fax,Latitude D830,test,45322223,Round Rock,Fax Plus Bios

When I enter the code via cmd I receive this:

Logging into Spiceworks…
Importing assets…
Error: no name attribute given in {:manually_added=>true, “—_”=>“Name”, nil=>"
Operating System ", “serial_number”=>nil, “description”=>“manually imported from
csv file”}
Had exception importing: exit
bulk_import.rb:13:in exit' bulk_import.rb:13:in eputs’
bulk_import.rb:133:in block in <main>' bulk_import.rb:125:in each’
bulk_import.rb:125:in `’
goodbye!

C:\Program Files\Spiceworks\bin>

Any idea what I am doing wrong?

2 Spice ups

in your csv file … if you open it with notepad or something other than excel… do you see a bunch of commas below the last rows of your text or does it only show the rows of valid data? sometimes if rows below the valid ones had any formatting it will try and comma delimit those rows which are blank

just make sure your file has only this and nothing more (when viewed in notepad)

Name,Manufacturer,Device Type,Model,IP Address,Serial Number,Location,Operating System
copier1,Apple,Copier,test,192.168.168.115,test,Austin,test
fax1,Acme,Fax,Latitude D830,test,45322221,Round Rock,Fax Plus Bios
fax2,Acme,Fax,Latitude D830,test,45322222,Cedar Park,Fax Plus Bios
fax3,Acme,Fax,Latitude D830,test,45322223,Round Rock,Fax Plus Bios

the error looks as if it sees a row with hyphens or nothing at all.

No there are no blank rows… I have attached a screenshot.

Error:

Logging into Spiceworks…
Importing assets…
Error: NoMethodError: undefined method operating_system_=' for #<Unknown:0x8e6f 9a8> Had exception importing: exit bulk_import.rb:13:in exit’
bulk_import.rb:13:in eputs' bulk_import.rb:147:in block in ’
bulk_import.rb:125:in each' bulk_import.rb:125:in
goodbye!

C:\Program Files\Spiceworks\bin>

I had a extra space in somewhere. I just copied your code and overwrote mine and it worked with no problems!

Thank you!

cool, always glad to help!

you can also import to any custom fields you’ve created … just reference the field name starting with ‘c_’ for custom c_fieldname as the column title