http://community.spiceworks.com/how_to/show/203-import-devices-into-spiceworks-from-a-csv-file<\/a><\/p>","upvoteCount":2,"datePublished":"2012-12-18T13:17:43.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/2","author":{"@type":"Person","name":"benhar","url":"https://community.spiceworks.com/u/benhar"}},"suggestedAnswer":[{"@type":"Answer","text":"
I use Wasp Inventory to print labels and I would like to export out of Wasp and import into spiceworks to update existing devices already in the inventory. I would like to match the device with the serial number in spiceworks and populate the asset tag field. Can this be done?<\/p>","upvoteCount":4,"datePublished":"2012-12-18T13:00:36.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/1","author":{"@type":"Person","name":"chandlerdelattre8346","url":"https://community.spiceworks.com/u/chandlerdelattre8346"}},{"@type":"Answer","text":"
Thanks for your support. This is what I have as a script to update the asset tag and it does not work. Thankfully it does not create a duplicate device.<\/p>\n
ruby bulk_import.rb -e email@domainname -p password --no-manual b_asset_tag filename.csv<\/p>","upvoteCount":0,"datePublished":"2012-12-18T14:20:41.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/3","author":{"@type":"Person","name":"chandlerdelattre8346","url":"https://community.spiceworks.com/u/chandlerdelattre8346"}},{"@type":"Answer","text":"
I believe the correct syntax is:<\/p>\n
… -m no-manual …<\/p>\n
Also the “b_…” fields are not user facing, so you should have ‘asset_tag’ in your line instead.<\/p>\n
(Be sure you’ve made a backup of your Spiceworks before all this)<\/p>","upvoteCount":2,"datePublished":"2012-12-18T14:33:56.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/4","author":{"@type":"Person","name":"benhar","url":"https://community.spiceworks.com/u/benhar"}},{"@type":"Answer","text":"
Thanks for the quick response.<\/p>\n
Here is the command and error:<\/p>\n
ruby bulk_import.rb -e email@domainname -p password -m no-manual asset_tag filename.csv<\/p>\n
error: bulk_import.rb:20:in ‘initialize’: No such file or directory - no-manual (errno:Enoent) from bulk_import.rb:20:in ‘open’ from bulk_import.rb:20:in ‘load_encoded_file’ from bulk_import.rb:121:in (main)’<\/p>","upvoteCount":0,"datePublished":"2012-12-18T14:50:42.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/5","author":{"@type":"Person","name":"chandlerdelattre8346","url":"https://community.spiceworks.com/u/chandlerdelattre8346"}},{"@type":"Answer","text":"
Let me check on this for you.<\/p>","upvoteCount":1,"datePublished":"2012-12-18T15:16:14.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/6","author":{"@type":"Person","name":"benhar","url":"https://community.spiceworks.com/u/benhar"}},{"@type":"Answer","text":"
Okay, so the ‘–no-manual’ was correct before.<\/p>\n
Try that and the ‘asset_tag’ field.<\/p>","upvoteCount":2,"datePublished":"2012-12-18T16:08:12.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/7","author":{"@type":"Person","name":"benhar","url":"https://community.spiceworks.com/u/benhar"}},{"@type":"Answer","text":"
Thanks for getting back to me. The --no-manual worked but when I list the asset_tag it barks at me. it says - no such file or directory for the asset_tag. Is there flag or something that needs to go in front of asset_tag. ex. -m asset_tag<\/p>\n
bulk_import.rb:20:in ‘initialize’ : No such file or directory - asset_tag (Errno::Enoent)<\/p>\n
from bulk_import.rb:20:in ‘open’<\/p>\n
from bulk_import.rb:20:in ‘load_encoded_file’<\/p>\n
from bulk_import.rb:121:in ‘(main)’<\/p>","upvoteCount":0,"datePublished":"2012-12-19T14:50:11.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/8","author":{"@type":"Person","name":"chandlerdelattre8346","url":"https://community.spiceworks.com/u/chandlerdelattre8346"}},{"@type":"Answer","text":"
It just smacked me in the face!<\/p>\n
Don’t put the field in the command line. That should be a column in your csv. I don’t know exactly what fields you have, but if you’re just updating the asset tag, you csv should look something like this:<\/p>\n
Name,Asset Tag \nComputer1,TW232 \nComputer2,TW233<\/p>\n
The “Name” should match what is in your Inventory already. You can add Serial Number too if you wish.<\/p>","upvoteCount":2,"datePublished":"2012-12-19T16:34:55.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/9","author":{"@type":"Person","name":"benhar","url":"https://community.spiceworks.com/u/benhar"}},{"@type":"Answer","text":"
Thanks. The csv is what it should be. All I have is the Name and Asset Tag in the csv file. I run the ruby bulk_import and it says it ran correctly but when I go to the inventory in spiceworks and refresh the device, it does not update the Asset Tag field.<\/p>\n
If I create a new device with the ruby program it populates what it should but does not update. I am going to try the ruby command with out the --no-manual command and see if it duplicates.<\/p>","upvoteCount":0,"datePublished":"2012-12-19T20:02:22.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/10","author":{"@type":"Person","name":"chandlerdelattre8346","url":"https://community.spiceworks.com/u/chandlerdelattre8346"}},{"@type":"Answer","text":"
You could also try ‘asset_tag’ as the column name.<\/p>","upvoteCount":1,"datePublished":"2012-12-19T20:13:18.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/11","author":{"@type":"Person","name":"benhar","url":"https://community.spiceworks.com/u/benhar"}},{"@type":"Answer","text":"
Good, I am getting to learn spiceworks ruby bulk_import.rb program a little more.<\/p>\n
the underscores in the columns help a lot.<\/p>","upvoteCount":0,"datePublished":"2012-12-20T16:48:11.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/12","author":{"@type":"Person","name":"chandlerdelattre8346","url":"https://community.spiceworks.com/u/chandlerdelattre8346"}},{"@type":"Answer","text":"\n\n
<\/div>\n Chandler Delattre:<\/div>\n
\nGood, I am getting to learn spiceworks ruby bulk_import.rb program a little more.<\/p>\n
the underscores in the columns help a lot.<\/p>\n<\/blockquote>\n<\/aside>\n
Yeah, I’m not sure why the how-to just shows the UI label, and not the actual database field. It’s possible that certain fields you can us the label, and others you need the db field name.<\/p>\n
If you get a SQLite browser program (SQLite Manager Firefox plugin is great), you can browse the database and get the table names and fields. *** DO NOT MAKE ANY CHANGES IN THE DATABASE DIRECTLY ***<\/p>","upvoteCount":0,"datePublished":"2012-12-20T17:57:03.000Z","url":"https://community.spiceworks.com/t/import-csv-to-spiceworks-to-update-existing-device-fields/182868/13","author":{"@type":"Person","name":"benhar","url":"https://community.spiceworks.com/u/benhar"}}]}}
I use Wasp Inventory to print labels and I would like to export out of Wasp and import into spiceworks to update existing devices already in the inventory. I would like to match the device with the serial number in spiceworks and populate the asset tag field. Can this be done?
4 Spice ups
benhar
(benhar)
December 18, 2012, 1:17pm
2
2 Spice ups
Thanks for your support. This is what I have as a script to update the asset tag and it does not work. Thankfully it does not create a duplicate device.
ruby bulk_import.rb -e email@domainname -p password --no-manual b_asset_tag filename.csv
benhar
(benhar)
December 18, 2012, 2:33pm
4
I believe the correct syntax is:
… -m no-manual …
Also the “b_…” fields are not user facing, so you should have ‘asset_tag’ in your line instead.
(Be sure you’ve made a backup of your Spiceworks before all this)
2 Spice ups
Thanks for the quick response.
Here is the command and error:
ruby bulk_import.rb -e email@domainname -p password -m no-manual asset_tag filename.csv
error: bulk_import.rb:20:in ‘initialize’: No such file or directory - no-manual (errno:Enoent) from bulk_import.rb:20:in ‘open’ from bulk_import.rb:20:in ‘load_encoded_file’ from bulk_import.rb:121:in (main)’
benhar
(benhar)
December 18, 2012, 3:16pm
6
Let me check on this for you.
1 Spice up
benhar
(benhar)
December 18, 2012, 4:08pm
7
Okay, so the ‘–no-manual’ was correct before.
Try that and the ‘asset_tag’ field.
2 Spice ups
Thanks for getting back to me. The --no-manual worked but when I list the asset_tag it barks at me. it says - no such file or directory for the asset_tag. Is there flag or something that needs to go in front of asset_tag. ex. -m asset_tag
bulk_import.rb:20:in ‘initialize’ : No such file or directory - asset_tag (Errno::Enoent)
from bulk_import.rb:20:in ‘open’
from bulk_import.rb:20:in ‘load_encoded_file’
from bulk_import.rb:121:in ‘(main)’
benhar
(benhar)
December 19, 2012, 4:34pm
9
It just smacked me in the face!
Don’t put the field in the command line. That should be a column in your csv. I don’t know exactly what fields you have, but if you’re just updating the asset tag, you csv should look something like this:
Name,Asset Tag
Computer1,TW232
Computer2,TW233
The “Name” should match what is in your Inventory already. You can add Serial Number too if you wish.
2 Spice ups
Thanks. The csv is what it should be. All I have is the Name and Asset Tag in the csv file. I run the ruby bulk_import and it says it ran correctly but when I go to the inventory in spiceworks and refresh the device, it does not update the Asset Tag field.
If I create a new device with the ruby program it populates what it should but does not update. I am going to try the ruby command with out the --no-manual command and see if it duplicates.
benhar
(benhar)
December 19, 2012, 8:13pm
11
You could also try ‘asset_tag’ as the column name.
1 Spice up
Good, I am getting to learn spiceworks ruby bulk_import.rb program a little more.
the underscores in the columns help a lot.
benhar
(benhar)
December 20, 2012, 5:57pm
13
Good, I am getting to learn spiceworks ruby bulk_import.rb program a little more.
the underscores in the columns help a lot.
Yeah, I’m not sure why the how-to just shows the UI label, and not the actual database field. It’s possible that certain fields you can us the label, and others you need the db field name.
If you get a SQLite browser program (SQLite Manager Firefox plugin is great), you can browse the database and get the table names and fields. *** DO NOT MAKE ANY CHANGES IN THE DATABASE DIRECTLY ***