Find Unique Lines

Contents  Previous  Next

 

Menu: Search > Find Unique Lines

 

Default Shortcut Key: none

 

Macro function: FindUniqueLines()

 

The Find Unique Lines command can be used to locate all lines within the current file which are not duplicated elsewhere in the file.  The unique lines are copied, with line numbers, into an untitled file.  No change is made to the current file during the operation.

 

If a range of lines is selected, Find Unique Lines will operate only on that portion of the file.

 

The results are presented in alphabetic order.  The Sort Lines command can be used to sort by line numbers, if desired.

 

The effect of this command is similar to the Find Distinct Lines command, with an important difference: Find Unique Lines omits any lines which are duplicated from its report.  Find Distinct Lines includes duplicated lines, but places just a single instance of such lines in its report.  An example will clarify:

 

Original File's Content...

Find Unique Lines gives...

Find Distinct Lines gives...

AAA

AAA

AAA

BBB

DDD

BBB

BBB

EEE

CCC

CCC

FFF

DDD

CCC


EEE

DDD


FFF

EEE



FFF



 

 

bm1This command can be useful for finding items within a list which are not duplicated elsewhere in the list.  For example: given a list of zip codes to which deliveries must be made, Find Unique Lines could be used to find those zip codes for which only one delivery must be made, allowing special arrangements to be made.