In order to use the plugin for sorting/eliminating duplicates, the plugin must be either downloaded and installed (more involved) or added using the plugin manager. The latter versions of Notepad do not apparently include the TextFX plugin at all. This is the important part in this regex, a row is only matched (and removed), when there is exactly the same row following somewhere else in the file. (?=.*^\1$) this is a positive lookahead assertion. \s ?^ this part matches all whitespace characters (newlines!) till the start of the next row => This removes the newlines after the matchd row, so that no empty row is there after the replacement. The matched row is stored, because of the brackets around and accessible using \1 (.*?) matches any characters 0 or more times, but as few as possible (It matches exactly on row, this is needed because of the ". You need to check the options "Regular expression" and ". No sorting is needed for that and the duplicate rows can be anywhere in the file! This leaves from all duplicate rows the last occurrence in the file. Since Notepad Version 6 you can use this regex in the search and replace dialogue: ^(.*?)$\s ?^(?=.*^\1$)Īnd replace with nothing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |