Powershell Tip #125: Identify the duplicates headers of a CSV file

By | October 23, 2016

Tip: You can identify the headers duplicated in a CSV file.

It can happen if someone save as CSV an Excel file and some duplicates were repeated multiple times by mistake.

excel-file-duplicates-headers

When trying to import the CSV, we can only see the first duplicate found but not all of them (SamAccountName and Department).

import-csv-duplicates-powershell

Here we can see the two duplicates headers :

import-csv-duplicates-powershell-found

 


previous-buttonnext-button

One thought on “Powershell Tip #125: Identify the duplicates headers of a CSV file

  1. Pingback: Powershell Tip #126: Convert days, hours, minutes, seconds with New-TimeSpan | Powershell Guru

Leave a Reply

Your email address will not be published. Required fields are marked *