Tag or display duplicates in a sort
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
Bill
Tag or display duplicates in a sort
In the sort window there is a box to delete duplicate lines. Is it possible to display or tag the duplicates?
-
Roy Beatty
Re: Tag or display duplicates in a sort
In Perl it would be
s/^(.*\n)\1+/$1/gm;
But TextPad's regex engine does not permit "back references". That means you cannot use tags like \1 within a Find expression.
There's always TextPad's Sort command with the remove dupes option.
The Unix command uniq also removes adjacant dupe lines. -- There are several lite Win32 versions of Unix commands.
HTH,
Roy
s/^(.*\n)\1+/$1/gm;
But TextPad's regex engine does not permit "back references". That means you cannot use tags like \1 within a Find expression.
There's always TextPad's Sort command with the remove dupes option.
The Unix command uniq also removes adjacant dupe lines. -- There are several lite Win32 versions of Unix commands.
HTH,
Roy
-
Ed
Re: Tag or display duplicates in a sort
How desperate are you? If you *must* see duplicated entries then you could sort and save as file1 then sort, delete duplicates and save a file2. then compare the 2 files with ExamDiff Pro (really excellent shareware diff utility) http://www.prestosoft.com/examdiff/examdiffpro.htm
ignoring identical lines. A bit long winded but you at least will end up with the best diffs tool on your PC for future use;-)
ignoring identical lines. A bit long winded but you at least will end up with the best diffs tool on your PC for future use;-)
-
Roy Beatty
Re: Tag or display duplicates in a sort
From my earlier reply: <br>
> But TextPad's regex engine does not permit "back references". <br>
> That means you cannot use tags like \1 within a Find expression.
I am hereby correcting myself -- TextPad *Does* support backreferences in the Find expression. For example,<br>
Find: \(the \)\1+<br>
on "Goethe the the " will find "the the the".<br>
Find: \(\<[[:alnum:]]+\>\)[^[:alnum:]]+\1\><br>
will find *most* instances of repeated words. So tagged expressions *do* work inside a Find regex. Even nested tagged expressions.
Sorry for misleading everyone!
However, the original request was to locate repeated lines. Unfortunately, TextPad's RE engine thinks that "\(\n\)" has an unmatched "(" or ")". Using brackets, "\([\n]\)" fixes that, but the RE engine ignores "\n" inside of a [class expression]. So TextPad regex still ain't a solution.
Roy
> But TextPad's regex engine does not permit "back references". <br>
> That means you cannot use tags like \1 within a Find expression.
I am hereby correcting myself -- TextPad *Does* support backreferences in the Find expression. For example,<br>
Find: \(the \)\1+<br>
on "Goethe the the " will find "the the the".<br>
Find: \(\<[[:alnum:]]+\>\)[^[:alnum:]]+\1\><br>
will find *most* instances of repeated words. So tagged expressions *do* work inside a Find regex. Even nested tagged expressions.
Sorry for misleading everyone!
However, the original request was to locate repeated lines. Unfortunately, TextPad's RE engine thinks that "\(\n\)" has an unmatched "(" or ")". Using brackets, "\([\n]\)" fixes that, but the RE engine ignores "\n" inside of a [class expression]. So TextPad regex still ain't a solution.
Roy