Page 1 of 1

CSV issues

Posted: Wed Nov 21, 2018 4:15 pm
by apowershelluser
Hello, I'm trying to import a CSV from ServiceNow that consist of our incidents.
When I use import-csv C:\file.csv -header 'computername' it displays the first column
Which definitely ins't the computer, however if I do import-csv C:\file.csv | select-object -property 'computername'
It displays correct

Any ideas why?

Re: CSV issues

Posted: Wed Nov 21, 2018 4:40 pm
by apowershelluser
Sorry for posting in wrong board...

Re: CSV issues

Posted: Wed Nov 21, 2018 4:53 pm
by jvierra
If a CSV has headers you don' need to specify headers. If you specify a header then the whole file will be badly imported.

Re: CSV issues

Posted: Wed Nov 21, 2018 6:12 pm
by apowershelluser
Ha ha ha... badly imported.

That’s fine, I can figure out the rest.