@Jose-Emilio-Osorio said in Good Morning. How to see find and see only the lines duplicated in a file ?. Thanks:
I just need to verify which are the duplicates before they are deleted.
Since you say that you aren’t interested in getting the lines back to the original order it makes the solution much easier. It also means that you should not be concerned about which line is actually marked for deletion (question #1).
So the first step is to sort the file. You can select either ascending or descending lexicographical order, it makes no difference, except to the visual aspect (possibly easier on the eye when sorted ascending). This is achieved by selecting the “Sort Lines lexicographically Ascending” or “Sort Lines lexicographically Descending” which is under “Line Operations”, under the Edit menu.
Next we just need to mark (bookmark) the lines which are duplicates. This is achieved by using the “Mark” function, under “Search” menu.
Find What:(?-s)^(.+)\R(?=\1)
Make sure "Bookmark line is ticked. The cursor should be on the first line of the file, otherwise some duplicates might get missed. Wrap around should not be ticked (as we don’t want to consider the last line as a duplicate of the first). Search Mode must be “regular expression”. Click on the “Mark All” button.
The file will now show a number of lines that have a mark in the left margin, normally a blue circle. You can use “F2” or “Shift-F2” to move to the next (or previous) bookmarked line for viewing. These bookmarks might be erased if performing some more operations on the file, such as another sort. If this happens just run the Mark operation again.
To delete the bookmarked lines use the “Remove Bookmarked Lines” listed under “Bookmark” which is under the “Search” menu.
Terry