You can develop a tool that reads the CSV file and loops through every line.
For every line get weburl, listname, title, department, name and run the steps listed below:
- Get the web
If you have the webUrl you can use the code below
using (SPSite site = new SPSite(webUrl))
{
using (SPWeb web = elevatedsite.OpenWeb())
{
}
}
2. Get the list
SPList list = web.GetListFromUrl(web.Url + /Lists/ListName/Forms/AllItems.aspx);
3. Creates an item and sets the field values
SPListItem item = list.AddItem();
item[Title] = title;
item[Department] = department;
item[Name] = name;
4. Updates the item
item.Update();
The same can be achieved with PowerShell by write the logic above in PowerShell script.
- Edited by
Naim Murati
Monday, January 13, 2014 3:08 PM
- Marked as answer by
Dennis GuoMicrosoft contingent staff, Moderator
1 hour 48 minutes ago