Find Duplicates

From TED Notepad
Revision as of 21:48, 25 April 2011 by Jsimlo (talk | contribs)
This section is up to date for TED Notepad version 6.3.1.0.
Control page Control:feature:Find Duplicates

Find duplicates.. (Alt+Ctrl+X)

Searches the selection for duplicate lines. Then either counts and/or removes duplicates, or removes unique lines, depending on following options and choices:

  • All lines (remove duplicates) - Removes all duplicate lines, keeping exactly one instance of each original line. The order of resulting lines remains unchanged and from each two equal lines, the second one is removed. This is identical to the behavior of the Unique Lines tool.
  • Unique lines only - Removes all lines that have duplicates, leaving only those lines that were already unique. The order of resulting lines remains unchanged.
  • Duplicated lines only - Removes all lines that do not have duplicates, leaving only those lines that do have duplicates. The resulting lines are uniqued in the process, thus each resulting line appears only once in the results. The order of resulting lines remains unchanged.

Optionally, if the Count duplicates option is checked, the tool counts number of duplicates of each line and adds these numbers to the results. Each resulting line then contains a number of its duplicates, written in brackets, in front of that line.

Additionally, Leave empty lines option may be specified to spare all empty lines from being removed, counted or otherwise modified. This can, for example, prevent unwanted paragraph joining. If this option is not specified, even empty lines get counted and/or removed, which might not be always desired.

And finally, Ignore case option may be specified to ignore case when matching duplicates.

Example:
how much wood would a woodchuck chuck if a woodchuck could chuck wood
Result of Duplicated lines only:
wood a woodchuck chuck
Result of All lines (remove duplicates) with Count duplicates:
(1) how much (2) wood (1) would (2) a woodchuck (2) chuck (1) if (1) could


See also Unique Lines tool.