<?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[How to read every line in a file edit box]]></title><description><![CDATA[<p dir="auto">How to read every line in a file edit box</p>
<p dir="auto">Notepad++ can open many files at once.<br />
Now I want to traverse every line of each opened file.<br />
What function do I need to call?<br />
I don’t want to read files directly from the hard drive.<br />
I need to read them from the memory interface through an API<br />
What function should be called?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26031/how-to-read-every-line-in-a-file-edit-box</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 23:47:08 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26031.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Aug 2024 02:57:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to read every line in a file edit box on Mon, 19 Aug 2024 03:59:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/heraldww" aria-label="Profile: heraldww">@<bdi>heraldww</bdi></a> said in <a href="/post/96219">How to read every line in a file edit box</a>:</p>
<blockquote>
<p dir="auto">How to read every line in a file edit box</p>
<p dir="auto">Notepad++ can open many files at once.<br />
Now I want to traverse every line of each opened file.<br />
What function do I need to call?<br />
I don’t want to read files directly from the hard drive.<br />
I need to read them from the memory interface through an API<br />
What function should be called?</p>
</blockquote>
<p dir="auto">I assume you’re talking about writing a plugin or a script. I can give you a clue regarding plugins; the script logic should be similar, but I don’t know the details.</p>
<p dir="auto">To get the contents of an active tab, use <a href="https://www.scintilla.org/ScintillaDoc.html#SCI_GETTEXT" rel="nofollow ugc">SCI_GETTEXT</a> or <a href="https://www.scintilla.org/ScintillaDoc.html#SCI_GETLINE" rel="nofollow ugc">SCI_GETLINE</a>, along with other functions you’ll find described nearby in the same document to get the length of the text or the number of lines.</p>
<p dir="auto">Notepad++ keeps one or two views open, with a Scintilla control in each view and the document of the active tab in that view loaded into the Scintilla control; the documents in the other tabs are not loaded into Scintilla controls, and to the best of my knowledge there is no way to read their contents without loading them into a Scintilla control.</p>
<p dir="auto">You can switch active tabs, though, and thereby traverse all open files. I don’t have an example handy, but the information you need is in this <a href="https://npp-user-manual.org/docs/plugin-communication/" rel="nofollow ugc">Notepad++ documentation</a>.</p>
<p dir="auto"><a href="https://npp-user-manual.org/docs/plugin-communication/#2031nppm_getnbopenfiles" rel="nofollow ugc">NPPM_GETNBOPENFILES</a> will tell you how many files are open in each view, and <a href="https://npp-user-manual.org/docs/plugin-communication/#2052nppm_activatedoc" rel="nofollow ugc">NPPM_ACTIVATEDOC</a> will activate a specific document, so that should get you most of the way there.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/96220</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96220</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 19 Aug 2024 03:59:17 GMT</pubDate></item></channel></rss>