Difference between revisions of "Find Duplicates"
m |
|||
Line 1: | Line 1: | ||
− | <noinclude>{{manversion|6.0.0. | + | <noinclude>{{manversion|6.0.0.16|feature}}__NOTOC__</noinclude> |
====Find duplicates.. (Alt+Ctrl+X)==== | ====Find duplicates.. (Alt+Ctrl+X)==== | ||
Searches the selection for duplicate {{defined|lines}}. Then either counts and/or removes duplicates, or removes unique lines, depending on following options and choices: | Searches the selection for duplicate {{defined|lines}}. Then either counts and/or removes duplicates, or removes unique lines, depending on following options and choices: | ||
− | *{{field|All lines (remove duplicates)}} - Removes all duplicate {{defined|lines}}, keeping exactly one instance of each original line. The order of resulting {{defined|lines}} remains unchanged and from each two equal lines, the second one is removed. This is identical to the behavior of the {{feature|Unique | + | *{{field|Find Duplicates|All lines (remove duplicates)}} - Removes all duplicate {{defined|lines}}, keeping exactly one instance of each original line. The order of resulting {{defined|lines}} remains unchanged and from each two equal lines, the second one is removed. This is identical to the behavior of the {{feature|Unique Lines}} tool. |
− | *{{field|Unique lines only}} - Removes all {{defined|lines}} that have duplicates, leaving only those {{defined|lines}} that were already unique. The order of resulting {{defined|lines}} remains unchanged. | + | *{{field|Find Duplicates|Unique lines only}} - Removes all {{defined|lines}} that have duplicates, leaving only those {{defined|lines}} that were already unique. The order of resulting {{defined|lines}} remains unchanged. |
− | *{{field|Duplicated lines only}} - Removes all {{defined|lines}} that do not have duplicates, leaving only those {{defined|lines}} that do have duplicates. The resulting {{defined|lines}} are uniqued in the process, thus each resulting {{defined|line}} appears only once in the results. The order of resulting {{defined|lines}} remains unchanged. | + | *{{field|Find Duplicates|Duplicated lines only}} - Removes all {{defined|lines}} that do not have duplicates, leaving only those {{defined|lines}} that do have duplicates. The resulting {{defined|lines}} are uniqued in the process, thus each resulting {{defined|line}} appears only once in the results. The order of resulting {{defined|lines}} remains unchanged. |
− | Optionally, if the {{field|Count duplicates}} option is checked, the tool counts number of duplicates of each {{defined|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. | + | Optionally, if the {{field|Find Duplicates|Count duplicates}} option is checked, the tool counts number of duplicates of each {{defined|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, {{field|Leave empty lines}} option may be specified to spare all {{defined|empty lines}} from being removed, counted or otherwise modified. This can, for example, prevent unwanted {{defined|paragraph}} joining. If this option is not specified, even empty lines get counted and/or removed, which might not be always desired. | + | Additionally, {{field|Find Duplicates|Leave empty lines}} option may be specified to spare all {{defined|empty lines}} from being removed, counted or otherwise modified. This can, for example, prevent unwanted {{defined|paragraph}} joining. If this option is not specified, even empty lines get counted and/or removed, which might not be always desired. |
− | And finally, {{field|Ignore case}} option may be specified to {{defined|ignore case}} when matching duplicates. | + | And finally, {{field|Find Duplicates|Ignore case}} option may be specified to {{defined|ignore case}} when matching duplicates. |
{{example_start}}Example: | {{example_start}}Example: | ||
Line 27: | Line 27: | ||
{{example_end}} | {{example_end}} | ||
− | {{example_start}}Result of {{field|Duplicated lines only}}: | + | {{example_start}}Result of {{field|Find Duplicates|Duplicated lines only}}: |
{{example_body}}<nowiki>wood | {{example_body}}<nowiki>wood | ||
a woodchuck | a woodchuck | ||
Line 33: | Line 33: | ||
{{example_end}} | {{example_end}} | ||
− | {{example_start}}Result of {{field|All lines (remove duplicates)}} with {{field|Count duplicates}}: | + | {{example_start}}Result of {{field|Find Duplicates|All lines (remove duplicates)}} with {{field|Find Duplicates|Count duplicates}}: |
{{example_body}}<nowiki>(1) how much | {{example_body}}<nowiki>(1) how much | ||
(2) wood | (2) wood | ||
Line 42: | Line 42: | ||
(1) could</nowiki> | (1) could</nowiki> | ||
{{example_end}} | {{example_end}} | ||
+ | |||
+ | |||
+ | See also {{feature|Unique Lines}} tool. |
Revision as of 21:48, 25 April 2011
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 resultinglines
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 thoselines
that were already unique. The order of resultinglines
remains unchanged. - Duplicated lines only - Removes all
lines
that do not have duplicates, leaving only thoselines
that do have duplicates. The resultinglines
are uniqued in the process, thus each resultingline
appears only once in the results. The order of resultinglines
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.
how much wood would a woodchuck chuck if a woodchuck could chuck wood |
wood a woodchuck chuck |
(1) how much (2) wood (1) would (2) a woodchuck (2) chuck (1) if (1) could |
See also Unique Lines tool.