Show a list of same words before replacement
-
@Patrik-Spacek said in Show a list of same words before replacement:
could you create a .bat file or some small app runner where i can paste my file or text and just run it?
Some simple version of app that I dont have to code and so on?No need.
Thanks guys for all those suggestions, but i am not a coder…
I dont know python or any coding…Fortunately, you don’t have to know a whit of python, because @Alan-Kilborn already gave you the code that will work to accomplish this solution in Notepad++:
- Go to Plugins > Plugins Admin, and install the PythonScript plugin.
- Restart Notepad++ as necessary
- Plugins > Python Script > New Script, give it the name
WordCount.py
or similar - Copy/paste the script that Alan posted earlier
- Plugins > Python Script > Scripts >
WordCount.py
will run the script for you, and use Paste / Ctrl+V to paste the count data wherever you want it (a new file, whatever)
Once you know it works,
- Plugins > Python Script > Configuration…
- Select WordCount.py in the UserScripts
- Click the left Add to add that script to Menu Items list
- Make sure Initialisation is et to ATSTARTUP
- Click OK
- Exit Notepad++ and restart
- Settings > Shortcut Mapper > Plugin Commands
- Filter for
WordCount
- Select that line, click Modify, and set the keyboard shortcut you desire, and close the dialogs.
From now on, that keyboard shortcut will run the histogram (or you can go to Plugins > Python Script >
WordCount
), and it will put the word count in your clipboard buffer. Then all you have to do is paste the result somewhere.No programming required for you, because Alan already did the work.
-
@Patrik-Spacek said in Show a list of same words before replacement:
this kind of addition must be added to notepad++ in general
You seem to think like @carypt
Kindly refer to my previous post which started out with No. With a period after the…Some people are just paralyzed with fear about something like you describe. :-)
-
@PeterJones thanks Peter,
nothing is happening…
-
As I said,
From now on, that keyboard shortcut will run the histogram (or you can go to Plugins > Python Script > WordCount), and it will put the word count in your clipboard buffer. Then all you have to do is paste the result somewhere.
Did you paste somewhere after running the script?
-
@PeterJones ouch, i missed that paste to somewhere… yes, its working!
what about add command that opens a new doc in notepad++ and paste it right away?
also set in count order from highest to lowest? -
@Patrik-Spacek said in Show a list of same words before replacement:
what about add command that opens a new doc in notepad++
notepad.new()
and paste it right away?
editor.paste()
You may not be as far from programming as you think, if you try your hand at adding the above (hint: at the end of the script) :-)
-
@Alan-Kilborn that worked!
what about the order from highest count?
also, the text has numbers 000 connected to some words, is it possible to exclude them? -
It appears you are running this against a file that truly isn’t text.
That wasn’t in my original plans for it.
I don’t know that I really want to support that (with changes) and all that it could mean.
But of course you are free to figure out how to do it.I have concerns about a lot of things, but these lines in your output are especially concerning:
=18 =2 "=1
These should not occur (unless there is something “unseen” going on, because my search expression in the script requested that “word characters only” be searched for.
-
Thats fine, but somebody definitely should create a nice advanced addition to notepad++, its very useful.
My friend already coded all I need (in 20mins) and works perfectly, its compiled separately, but works great. (not in python)
-
@Patrik-Spacek said in Show a list of same words before replacement:
a nice advanced addition to notepad++
Sounds like a job for a plugin.
But just for that simple function, a little script serves well.
But if a potential plugin added a bunch of analysis features, of which a histogram is just one…well, that would be valuable.My friend already coded all I need (in 20mins) and works perfectly, its compiled separately, but works great. (not in python)
Sounds like overkill, but when one has to sponge off of a friend’s good will, you get what you get.
-
-