PowerShell Script – Duplicate TXT Entries Checker (Updated)
I've made some improvements to the PowerShell script that detects duplicate entries in TXT files.
Changes made:
The script now compares only the key from the beginning of each line up to and including the first =.
The translated text after the = is ignored during comparison.
Case-sensitive comparison is used. For example, Accident hazard= and accident hazard= are treated as two different keys.
If a key appears multiple times, it is listed only once in the results.
The first complete original line is preserved, including its translation.
The script counts the total number of duplicate keys and the number of lines listed.
The results are automatically saved as Duplicates.txt in the same folder as the selected TXT file.
A message box displays the results and the output file location.
Example:
If the source file contains:
Accident hazard="Accident warning"
Accident hazard="Danger of accident"
accident hazard="Accident hazard"
accident hazard="Warning of an accident"
The output will contain:
Accident hazard="Accident warning"
accident hazard="Accident hazard"
This way, duplicate keys are identified correctly without mixing uppercase and lowercase entries, and each duplicate key is reported only once.



Likes:
Reply With Quote

Bookmarks