Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I have a CSV file that has a couple columns that are the same. It looks like Import-csv doesn't like this and gives me the error below. Is there any I can ignore or bypass the repeat column so I can avoid this error?
I need the other columns and there are a lot since this is a perfmon CSV. It is just one or two of them have the same name. Is there any other way to ignore the other duplicate columns.
So what I was thinking was using a get-content and do a select on the first line then use a get-unique to remove the dups but it seems the get-unique is not working. Am I missing something?
sekou2331 wrote:So what I was thinking was using a get-content and do a select on the first line then use a get-unique to remove the dups but it seems the get-unique is not working. Am I missing something?
I am sorry I am kind of confused. When I try to use anything to do Import-csv I get the error that the member is already present. How do I bypass that?
Sorry for the late replay but below is what I tried and it didn't work. I tried to do a simple skip of the first row like with Get-content. But it still give me the same error.
This topic is 7 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.