<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Show a list of same words before replacement]]></title><description><![CDATA[<p dir="auto">Guys,<br />
is there a automatic word list that shows you the count of the most used / repeated words in the document?<br />
i.e. I would like to open a window list, that shows me from top to bottom the most repeatable words in the specific doc.</p>
<p dir="auto">the - 354<br />
train - 253<br />
cool - 128<br />
hope - 89<br />
etc.</p>
<p dir="auto">that helps me a lot with translation instead of guessing or typing manually in search.</p>
<p dir="auto">Thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20598/show-a-list-of-same-words-before-replacement</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 10:43:02 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20598.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Jan 2021 18:48:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Show a list of same words before replacement on Wed, 20 Jan 2021 19:16:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrik-spacek" aria-label="Profile: Patrik-Spacek">@<bdi>Patrik-Spacek</bdi></a> said in <a href="/post/62071">Show a list of same words before replacement</a>:</p>
<blockquote>
<p dir="auto">a nice advanced addition to notepad++</p>
</blockquote>
<p dir="auto">Sounds like a job for a plugin.<br />
But just for that simple function, a little script serves well.<br />
But if a potential plugin added a bunch of analysis features, of which a histogram is just one…well, that would be valuable.</p>
<blockquote>
<p dir="auto">My friend already coded all I need (in 20mins) and works perfectly, its compiled separately, but works great. (not in python)</p>
</blockquote>
<p dir="auto">Sounds like overkill, but when one has to sponge off of a friend’s good will, you get what you get.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/62073</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62073</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 20 Jan 2021 19:16:15 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Wed, 20 Jan 2021 19:04:30 GMT]]></title><description><![CDATA[<p dir="auto">Thats fine, but somebody definitely should create a nice advanced addition to notepad++, its very useful.</p>
<p dir="auto">My friend already coded all I need (in 20mins) and works perfectly, its compiled separately, but works great. (not in python)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/62071</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62071</guid><dc:creator><![CDATA[Patrik Spacek]]></dc:creator><pubDate>Wed, 20 Jan 2021 19:04:30 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Wed, 20 Jan 2021 01:33:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrik-spacek" aria-label="Profile: Patrik-Spacek">@<bdi>Patrik-Spacek</bdi></a></p>
<p dir="auto">It appears you are running this against a file that truly isn’t text.<br />
That wasn’t in my original plans for it.<br />
I don’t know that I really want to support that (with changes) and all that it could mean.<br />
But of course you are free to figure out how to do it.</p>
<p dir="auto">I have concerns about a lot of things, but these lines in your output are especially concerning:</p>
<pre><code class="language-z">=18
 =2
"=1
</code></pre>
<p dir="auto">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.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/62041</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62041</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 20 Jan 2021 01:33:21 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Tue, 19 Jan 2021 22:10:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> that worked!</p>
<p dir="auto">what about the order from highest count?<br />
also, the text has numbers 000 connected to some words, is it possible to exclude them?</p>
<p dir="auto"><img src="/assets/uploads/files/1611094238535-7073dbfd-a357-445f-9946-fd41e1132ca5-image.png" alt="7073dbfd-a357-445f-9946-fd41e1132ca5-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/62038</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62038</guid><dc:creator><![CDATA[Patrik Spacek]]></dc:creator><pubDate>Tue, 19 Jan 2021 22:10:40 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Tue, 19 Jan 2021 22:05:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrik-spacek" aria-label="Profile: Patrik-Spacek">@<bdi>Patrik-Spacek</bdi></a> said in <a href="/post/62035">Show a list of same words before replacement</a>:</p>
<blockquote>
<p dir="auto">what about add command that opens a new doc in notepad++</p>
</blockquote>
<p dir="auto"><code>notepad.new()</code></p>
<blockquote>
<p dir="auto">and paste it right away?</p>
</blockquote>
<p dir="auto"><code>editor.paste()</code></p>
<p dir="auto">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)  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/62037</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62037</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Jan 2021 22:05:17 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Tue, 19 Jan 2021 22:01:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> ouch, i missed that paste to somewhere…   yes, its working!</p>
<p dir="auto">what about add command that opens a new doc in notepad++ and paste it right away?<br />
also set in count order from highest to lowest?</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/62035</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62035</guid><dc:creator><![CDATA[Patrik Spacek]]></dc:creator><pubDate>Tue, 19 Jan 2021 22:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Tue, 19 Jan 2021 21:50:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrik-spacek" aria-label="Profile: Patrik-Spacek">@<bdi>Patrik-Spacek</bdi></a></p>
<p dir="auto">As I said,</p>
<blockquote>
<p dir="auto">From now on, that keyboard shortcut will run the histogram (or you can go to Plugins &gt; Python Script &gt; WordCount), and it will put the word count in your clipboard buffer. Then all you have to do is paste the result somewhere.</p>
</blockquote>
<p dir="auto">Did you paste somewhere after running the script?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/62034</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62034</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Jan 2021 21:50:40 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Tue, 19 Jan 2021 21:49:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> thanks Peter,</p>
<p dir="auto">nothing is happening…</p>
<p dir="auto"><img src="/assets/uploads/files/1611092956985-ea6f6976-7a92-4534-8dd8-c8161e7e079a-image.png" alt="ea6f6976-7a92-4534-8dd8-c8161e7e079a-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/62033</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62033</guid><dc:creator><![CDATA[Patrik Spacek]]></dc:creator><pubDate>Tue, 19 Jan 2021 21:49:19 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Tue, 19 Jan 2021 21:22:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrik-spacek" aria-label="Profile: Patrik-Spacek">@<bdi>Patrik-Spacek</bdi></a> said in <a href="/post/62024">Show a list of same words before replacement</a>:</p>
<blockquote>
<p dir="auto">this kind of addition must be added to notepad++ in general</p>
</blockquote>
<p dir="auto">You seem to think like <a class="plugin-mentions-user plugin-mentions-a" href="/user/carypt" aria-label="Profile: carypt">@<bdi>carypt</bdi></a><br />
Kindly refer to my previous post which started out with <em>No. With a period after the…</em></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<p dir="auto">Some people are just paralyzed with fear about something like you describe.  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/62028</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62028</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Jan 2021 21:22:58 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Tue, 19 Jan 2021 21:12:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrik-spacek" aria-label="Profile: Patrik-Spacek">@<bdi>Patrik-Spacek</bdi></a> said in <a href="/post/62024">Show a list of same words before replacement</a>:</p>
<blockquote>
<p dir="auto">could you create a .bat file or some small app runner where i can paste my file or text and just run it?<br />
Some simple version of app that I dont have to code and so on?</p>
</blockquote>
<p dir="auto">No need.</p>
<blockquote>
<p dir="auto">Thanks guys for all those suggestions, but i am not a coder…<br />
I dont know python or any coding…</p>
</blockquote>
<p dir="auto">Fortunately, you don’t have to know a whit of python, because <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> already gave you the code that will work to accomplish this solution in Notepad++:</p>
<ol>
<li>Go to Plugins &gt; Plugins Admin, and install the PythonScript plugin.</li>
<li>Restart Notepad++ as necessary</li>
<li>Plugins &gt; Python Script &gt; New Script, give it the name <code>WordCount.py</code> or similar</li>
<li>Copy/paste the script that Alan posted earlier</li>
<li>Plugins &gt; Python Script &gt; Scripts &gt; <code>WordCount.py</code> will run the script for you, and use Paste / Ctrl+V to paste the count data wherever you want it (a new file, whatever)</li>
</ol>
<p dir="auto">Once you know it works,</p>
<ol start="6">
<li>Plugins &gt; Python Script &gt; Configuration…</li>
<li>Select <a href="http://WordCount.py" rel="nofollow ugc">WordCount.py</a> in the UserScripts</li>
<li>Click the left <strong>Add</strong> to add that script to Menu Items list</li>
<li>Make sure Initialisation is et to ATSTARTUP</li>
<li>Click OK</li>
<li>Exit Notepad++ and restart</li>
<li>Settings &gt; Shortcut Mapper &gt; Plugin Commands</li>
<li>Filter for <code>WordCount</code></li>
<li>Select that line, click <strong>Modify</strong>, and set the keyboard shortcut you desire, and close the dialogs.</li>
</ol>
<p dir="auto">From now on, that keyboard shortcut will run the histogram (or you can go to Plugins &gt; Python Script &gt; <code>WordCount</code>), and it will put the word count in your clipboard buffer.  Then all you have to do is paste the result somewhere.</p>
<p dir="auto">No programming required for you, because Alan already did the work.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/62027</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62027</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Jan 2021 21:12:43 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Tue, 19 Jan 2021 20:59:04 GMT]]></title><description><![CDATA[<p dir="auto">Thanks guys for all those suggestions, but i am not a coder…  and apps like “word frequency counter” show lots of errors if I paste text with 9000 lines…</p>
<p dir="auto">I dont know python or any coding…could you create a .bat file or some small app runner where i can paste my file or text and just run it?</p>
<p dir="auto">Some simple version of app that I dont have to code and so on?<br />
BTW this kind of addition must be added to notepad++ in general :/.</p>
<p dir="auto">Thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/post/62024</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/62024</guid><dc:creator><![CDATA[Patrik Spacek]]></dc:creator><pubDate>Tue, 19 Jan 2021 20:59:04 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Sun, 17 Jan 2021 13:29:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a>   but … ty for guiding me to “text-mining”. )</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61950</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61950</guid><dc:creator><![CDATA[carypt]]></dc:creator><pubDate>Sun, 17 Jan 2021 13:29:44 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Sun, 17 Jan 2021 13:15:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a>   ok , meh</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61949</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61949</guid><dc:creator><![CDATA[carypt]]></dc:creator><pubDate>Sun, 17 Jan 2021 13:15:01 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Sun, 17 Jan 2021 13:08:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/carypt" aria-label="Profile: carypt">@<bdi>carypt</bdi></a></p>
<p dir="auto">No.  With a period after the “no”.</p>
<p dir="auto">Word-histogramming (as I showed with the script) and the other things you so interestingly described are more functions of word-processing software or grammar-analyzing software, or, to the point, special-purpose software.</p>
<p dir="auto">A text editor is, by definition, a fairly general purpose tool.<br />
N++ provides <em>some</em> advanced capability, but it centers around general-purpose needs.  Examples include sorting lines, removing duplicate lines…</p>
<p dir="auto">“…finding rhymes, negatives of characters, tempered chords, rhythm (which I can spell correctly), plagarism, structure analysis…” – all very special purpose.</p>
<blockquote>
<p dir="auto">historam (sic!)</p>
</blockquote>
<p dir="auto">I know what <em>sic</em> means, but I certainly don’t know what you’re implying with its usage here.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61948</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61948</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sun, 17 Jan 2021 13:08:45 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Sun, 17 Jan 2021 12:59:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a>   why would i ? because everywhere when it comes into tricky needs , people get directed to npp , because you can do “everything” with it . fine , yes , if you can code a bit as it seems , or by help of others . this text-analysing , quenching , reformatting , experimenting stuff i do expect npp to be able . finding rhymes , wrap everything around , giving negatives of characters , or tempered chords of syllables , counting rythm , finding copypasted phrases in dissertaions , plagiarism . finding sentence lenght , word historam (sic !) , sentence structure analysis . book eating stuff . playing with words .</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61947</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61947</guid><dc:creator><![CDATA[carypt]]></dc:creator><pubDate>Sun, 17 Jan 2021 12:59:07 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Sat, 16 Jan 2021 00:12:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/carypt" aria-label="Profile: carypt">@<bdi>carypt</bdi></a> said in <a href="/post/61882">Show a list of same words before replacement</a>:</p>
<blockquote>
<p dir="auto">this is the stuff i expect npp to do by default</p>
</blockquote>
<p dir="auto">WHY would you expect this??</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61901</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61901</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 16 Jan 2021 00:12:13 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Fri, 15 Jan 2021 22:45:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a>   ooh , thank you for sharing your python-script , this is the stuff i expect npp to do by default . yes , thank you , litrature researchers want to know these facts , dont they ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61882</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61882</guid><dc:creator><![CDATA[carypt]]></dc:creator><pubDate>Fri, 15 Jan 2021 22:45:46 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Fri, 15 Jan 2021 18:27:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/61840">Show a list of same words before replacement</a>:</p>
<blockquote>
<p dir="auto">I don’t understand ! For instance, with the previous search regex</p>
</blockquote>
<p dir="auto">I found out the problem.<br />
I neglected to follow this part of the original instruction:</p>
<blockquote>
<p dir="auto">Move the caret at beginning of the list</p>
</blockquote>
<p dir="auto">After doing that, the regex replacement works fine for me.  Sorry for the confusion.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61862</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61862</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 15 Jan 2021 18:27:26 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Fri, 15 Jan 2021 18:15:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a></p>
<p dir="auto">By the way, it may pay dividends to become familiar with the <code>format</code> function’s formatting codes – I’ll be using that same syntax as a user-input parameter for my upcoming script posting for “replacing using an incrementing count value”.</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/topic/19414/replace-text-with-incremented-counter">Reference</a> (but no, nothing new there YET!)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61858</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61858</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 15 Jan 2021 18:15:52 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Fri, 15 Jan 2021 15:20:32 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>,</p>
<p dir="auto">I don’t understand ! For instance, with the <strong>previous</strong> search regex :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(=)|^.{18}\K\.+</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>(?1.............................. )</code></strong></p>
</li>
</ul>
<p dir="auto">and <strong><code>TWO</code> consecutive</strong> clicks on the <strong><code>Replace All</code></strong> button</p>
<p dir="auto">this text :</p>
<pre><code class="language-z">a=5
bc=1
def=150
ghij=17
</code></pre>
<p dir="auto">is changed into :</p>
<pre><code class="language-z">a................. 5
bc................ 1
def............... 150
ghij.............. 17
</code></pre>
<hr />
<p dir="auto">Anyway, you guessed <strong>well</strong> and, thanks to your explanations about <strong>Python</strong> formating,  I chose the <strong><code>'{0:.&lt;18} {1}'.format</code></strong> syntax with a <strong>space</strong> between the <strong>last</strong> dot and the <strong>number</strong>. Super !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61840</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61840</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 15 Jan 2021 15:20:32 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Fri, 15 Jan 2021 13:21:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/61816">Show a list of same words before replacement</a>:</p>
<blockquote>
<p dir="auto">Now, to get a better output :</p>
</blockquote>
<p dir="auto">Hmm, not sure what you were going for here, but when I tried the regex replacement you offered, nothing happened to the file (0 replacements).  ??</p>
<p dir="auto">I’m guessing that you meant for something like this to happen:</p>
<p dir="auto">My original output:</p>
<pre><code class="language-z">After=1
Alice=3
Angeles=1
Bob=7
But=1
Cannon=1
Carol=6
Culp=1
Disturbed=1
Don=1
</code></pre>
<p dir="auto">to be transformed into something like:</p>
<pre><code class="language-z">After.............1
Alice.............3
Angeles...........1
Bob...............7
But...............1
Cannon............1
Carol.............6
Culp..............1
Disturbed.........1
Don...............1
</code></pre>
<p dir="auto">If so, we can do this easily, right in the Python; let me walk you through it…</p>
<p dir="auto">See this part of the original script:</p>
<p dir="auto"><code>'{}={}'.format(</code>…</p>
<p dir="auto">I was a bit lazy with that.  I should have done this:</p>
<p dir="auto"><code>'{0}={1}'.format(</code>…</p>
<p dir="auto">This means, take the two parameters supplied to the format function, and insert them into the <code>{}</code> placeholders in the format string, according to their position.  0 would be the first parameter to format, 1 would be the second.  Thus we get simple <code>Bob=7</code> output for our problem at hand.</p>
<p dir="auto">Note that if numbers (e.g. the 0 and the 1) are not supplied, the numbering is implied, left to right, starting at zero and counting up by one each time a <code>{}</code> is encountered.</p>
<p dir="auto">Okay, so that’s all fine, but if we want <em>special</em> formatting (this is the <em>format</em> function after all), we can add a colon after the number and supply some formatting codes, e.g.:</p>
<p dir="auto"><code>'{0:.&lt;18}{1}'.format(</code>…</p>
<p dir="auto">This means, for the first parameter to format, reserve a field width 18 wide, left-justify the parameter value in this field (specified with the <code>&lt;</code>), and pad any remaining empty space in the field with the <code>.</code> character.</p>
<p dir="auto">And this indeed does generate the “transformed” output I showed above, when the script is changed and re-run.</p>
<p dir="auto">More on the <code>format()</code> function and what it can do is here:<br />
<a href="https://docs.python.org/2.7/library/string.html#format-string-syntax" rel="nofollow ugc">https://docs.python.org/2.7/library/string.html#format-string-syntax</a><br />
It’s a bit heavy, but scrolling down one finds an “examples” section, which maybe helps.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61831</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61831</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 15 Jan 2021 13:21:21 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Fri, 15 Jan 2021 11:16:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/patrik-spacek" aria-label="Profile: patrik-spacek">@<bdi>patrik-spacek</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>,</p>
<p dir="auto"><strong>Alan</strong>, I’ve just tried your <strong>Python</strong> script, that I named <strong><code>Counting_Words.py</code></strong> and …Wow, very <strong>nice</strong> ! It’s typically the kind of task for a <strong>computer</strong> ;-))</p>
<p dir="auto">Now, to get a <strong>better</strong> output :</p>
<ul>
<li>
<p dir="auto">Move the caret at <strong>beginning</strong> of the list</p>
</li>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog <strong><code>Ctrl + H</code></strong> )</p>
</li>
<li>
<p dir="auto">SEARCH <strong><code>(=)|^.{18}\K\.+</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>(?1.............................. )</code></strong></p>
</li>
<li>
<p dir="auto"><strong>Untick</strong> the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto">Click <em>TWICE</em> on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
<hr />
<p dir="auto">I still plan to “<strong>play</strong>” with your script and I’ll let you know my <strong>impressions</strong> soon ;-))</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61816</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61816</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 15 Jan 2021 11:16:58 GMT</pubDate></item><item><title><![CDATA[Reply to Show a list of same words before replacement on Thu, 14 Jan 2021 19:31:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrik-spacek" aria-label="Profile: Patrik-Spacek">@<bdi>Patrik-Spacek</bdi></a></p>
<p dir="auto">Here’s a Pythonscript I had on hand that copies to the clipboard a word histogram like you show, based on the word content of the current document; obviously requires use of the Pythonscript plugin.</p>
<p dir="auto">It’s not perfect the way it is, e.g. it would show <code>s</code> as a word when it scans <code>It's</code>, but as a base thing, it’s not bad.</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-

from Npp import editor

word_matches = []
def match_found(m): word_matches.append(editor.getTextRange(m.span(0)[0], m.span(0)[1]))
editor.research('\w+', match_found)
histogram_dict = {}
for word in word_matches:
    if word not in histogram_dict:
        histogram_dict[word] = 1
    else:
        histogram_dict[word] += 1
output_list = []
for k in histogram_dict: output_list.append('{}={}'.format(k, histogram_dict[k]))
output_list.sort()
editor.copyText('\r\n'.join(output_list))
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/61801</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61801</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 14 Jan 2021 19:31:39 GMT</pubDate></item></channel></rss>