Creating a tally count of line duplicates
-
Hello, I am wondering if Notepad++ has the ability to not just remove duplicate lines, but also count them and generate a tally table. Here is a javascript website that does what I’m looking for, but I would love if NPP also had this capability.
fox fox dog cat fox cat foxbecomes
COUNT | LINE ----------------------------------------------------- 4 | fox 2 | cat 1 | dog ----------------------------------------------------- 7 | TOTAL LINES -
@a-raccoon said in Creating a tally count of line duplicates:
but also count them and generate a tally table
There isn’t a native function within Notepad++, however a search through this forum found this post with a PythonScript program that with slight modification could do a line histograph. I note your example suggested your lines are in fact single words each on a different line, so if that’s the case then the program as it stands should work.
Its here.
Terry
-
Thanks for the find @terry-r, I’ll find that PythonScript plugin and play with it.
I assume I should be able to change the regex pattern to suit my needs in the line
editor.research('\w+', match_found)to something likeeditor.research('^.*$', match_found)to perform a histogram by line.Much appreciated.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login