<?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[Find all in current document don&#x27;t provide father object]]></title><description><![CDATA[<p dir="auto">I have a structured files XML that for each &lt;object&gt; has many informations.<br />
example:</p>
<p dir="auto">&lt;object name=“A”&gt;<br />
info1 = 3<br />
info2 = 5<br />
info3 = 7<br />
&lt;/object&gt;<br />
&lt;object name=“B”&gt;<br />
info1 = 5<br />
info2 = 8<br />
info3 = 0<br />
&lt;/object&gt;</p>
<p dir="auto">when I try to “Find all in current document” -&gt; “info1” I got all the line that has “info1” text included:</p>
<p dir="auto">info1=3<br />
info1=5</p>
<p dir="auto">but I don’t know which is the father object. Since I have thousand of objects and thousand of info, it is difficult to understand which object has info1 set to 3 and which has info 1 set to 5. So I guess if there is a way to have as result the following:</p>
<p dir="auto">&lt;object name=“A”&gt; / info1=3<br />
&lt;object name=“B”&gt; / info1=5</p>
<p dir="auto">Is there any way to do this?<br />
Thanks a lot</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/15622/find-all-in-current-document-don-t-provide-father-object</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 11:29:21 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/15622.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Apr 2018 18:13:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find all in current document don&#x27;t provide father object on Mon, 30 Apr 2018 05:35:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/massimo" aria-label="Profile: Massimo">@<bdi>Massimo</bdi></a> Araldi<br />
The information about the father object is available using Notepad++ and XPatherizerNpp plugin:<br />
all you have to do is search the XPath and watch the results window.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/31921</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/31921</guid><dc:creator><![CDATA[Gogo Neatza]]></dc:creator><pubDate>Mon, 30 Apr 2018 05:35:22 GMT</pubDate></item><item><title><![CDATA[Reply to Find all in current document don&#x27;t provide father object on Tue, 24 Apr 2018 08:34:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello,<br />
sorry for my late answer…I had some unexpected issue in the meanwhile.<br />
Sorry for my not clear description, it’s my first time in the forum, by the way I think that your suggestion hit my target, just I need time to better understand how to implement it…<br />
I understand in any case that I need to work more on this issue because there is a possibility to obtain the result, implementing yoursuggestion… I just need to hard work.<br />
Thanks a lot</p>
]]></description><link>https://community.notepad-plus-plus.org/post/31831</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/31831</guid><dc:creator><![CDATA[Massimo Araldi]]></dc:creator><pubDate>Tue, 24 Apr 2018 08:34:26 GMT</pubDate></item><item><title><![CDATA[Reply to Find all in current document don&#x27;t provide father object on Sun, 15 Apr 2018 10:10:53 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: scott-sumner">@<bdi>scott-sumner</bdi></a>,</p>
<p dir="auto">I do agree with your <strong>last</strong> sentence. Sure that people should take care to <strong>explain</strong> their needs and <strong>provide</strong> examples in such a way that a <strong>minimum</strong> of <strong>ambiguities</strong> remains !</p>
<p dir="auto">Your <strong>last</strong> post wasn’t <strong>useless</strong>, anyway ! Indeed, as I’m <strong>French</strong>, I’ve just learned some other <strong>English-American</strong> words and expressions : to elicit, to hit the bull’s eye, to bail out and the very <strong>comprehensive</strong> expression “to chase the wind” ;-))</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/31676</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/31676</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 15 Apr 2018 10:10:53 GMT</pubDate></item><item><title><![CDATA[Reply to Find all in current document don&#x27;t provide father object on Sat, 14 Apr 2018 22:46:08 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">Yeah…hard to know <em>really</em> what is wanted or what direction something could be going…  In an effort to be helpful, I take a few minutes and put something quick together which hopefully elicits more info from the OP, or maybe (rarely) manages to hit the bullseye.  Sure, we can <em>guess</em> and propose 3 or 4 (or 9 or 10!) alternatives on what might be useful to the posters, but <em>I’m</em> not doing that!  :-)</p>
<p dir="auto">I don’t know if you’ve noticed on these type of postings, I’ll reply, and then if the OP replies to that and completely changes the specification for what is wanted, I’ll bail out because I’m simply not interested in “chasing the wind”…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/31671</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/31671</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 14 Apr 2018 22:46:08 GMT</pubDate></item><item><title><![CDATA[Reply to Find all in current document don&#x27;t provide father object on Sun, 15 Apr 2018 07:08:21 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/massimo-araldi" aria-label="Profile: massimo-araldi">@<bdi>massimo-araldi</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: scott-sumner">@<bdi>scott-sumner</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">I think that this task would be <strong>easily</strong> achieve with a <strong>scripting</strong> language as, for instance, the <strong>Python</strong> or <strong>Lua</strong> N++ plugins !</p>
<p dir="auto">However, here are <strong><code>3</code></strong> simple work-arounds to <strong>simulate</strong> your needs :-))</p>
<p dir="auto">We’ll always use the <strong>sample</strong> text below, <strong>throughout</strong> this post :</p>
<pre><code class="language-diff">&lt;object name="A"&gt;
info1 = 3
info2 = 5
info3 = 7
&lt;/object&gt;
&lt;object name="B"&gt;
info1 = 5
info3 = 0
info5 = 10
info6 = 
info7 = -2
&lt;/object&gt;
&lt;object name="C"&gt;
info2 = 9
info7 = 1
&lt;/object&gt;
&lt;object name="D"&gt;
info1 = 4
info3 = 2
&lt;/object&gt;
&lt;object name="E"&gt;
info2 = 8
info4 = 6
&lt;/object&gt;
</code></pre>
<hr />
<p dir="auto"><strong>A)</strong> If you <strong>just</strong> want to know which <strong>father</strong> object(s) contains a specific <strong><code>info#</code></strong> value, in the <strong>Find result</strong> panel :</p>
<p dir="auto">Use the <strong>generic</strong> regex <strong><code>(?-i)&lt;object name="\K\w+(?="[^/]+?</code>&lt;Text to Find&gt;<code>)</code></strong>, where <strong>&lt;Text to Find&gt;</strong> must be replaced with any <strong><code>info#</code></strong> value</p>
<p dir="auto">So, if the <strong>Find what:</strong> zone contains, for instance, the regex <strong><code>(?-i)&lt;object name="\K\w+(?="[^/]+?info3)</code></strong>, with the <strong><code>Wrap around</code></strong> option <strong>ticked</strong> and the <strong><code>Regular expression</code></strong> <strong>selected</strong>, clicking on the <strong><code>Find All in Current Document</code></strong> would display, in the <strong>Find result</strong> panel :</p>
<pre><code class="language-diff">Search "(?-i)&lt;object name="\K\w+(?="[^/]+?info3)" (3 hits in 1 file)
  new 3 (3 hits)
	Line 1: &lt;object name="A"&gt;
	Line 6: &lt;object name="B"&gt;
	Line 17: &lt;object name="D"&gt;
</code></pre>
<hr />
<p dir="auto"><strong>B)</strong> If you want to get, <strong>both</strong>, the <strong><code>info# = #</code></strong> line AND its corresponding <strong>father</strong> object, in the <strong>Find result</strong> panel :</p>
<ul>
<li>
<p dir="auto"><strong>Copy</strong> all your file contents in a <strong>new</strong> tab</p>
</li>
<li>
<p dir="auto"><strong>Switch</strong> to that <strong>new</strong> tab</p>
</li>
<li>
<p dir="auto">Open the <strong>Replace</strong> Dialog</p>
</li>
</ul>
<p dir="auto">SEARCH <strong><code>\R(?!&lt;object)</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
<ul>
<li>With the <strong>same</strong> options as <strong>above</strong>, click  on the <strong><code>Replace All</code></strong> button</li>
</ul>
<p dir="auto">You should get the following text :</p>
<pre><code class="language-diff">&lt;object name="A"&gt; info1 = 3 info2 = 5 info3 = 7 &lt;/object&gt;
&lt;object name="B"&gt; info1 = 5 info3 = 0 info5 = 10 info6 =  info7 = -2 &lt;/object&gt;
&lt;object name="C"&gt; info2 = 9 info7 = 1 &lt;/object&gt;
&lt;object name="D"&gt; info1 = 4 info3 = 2 &lt;/object&gt;
&lt;object name="E"&gt; info2 = 8 info4 = 6 &lt;/object&gt;
</code></pre>
<ul>
<li>Now, in the <strong>Find</strong> tab, simply search for <strong><code>info3</code></strong> and click on the <strong><code>Find All in Current Document</code></strong></li>
</ul>
<p dir="auto">You’ll get the <strong>expected</strong> text :</p>
<pre><code class="language-diff">Search "info3" (3 hits in 1 file)
  new 3 (3 hits)
	Line 1: &lt;object name="A"&gt; info1 = 3 info2 = 5 info3 = 7 &lt;/object&gt;
	Line 2: &lt;object name="B"&gt; info1 = 5 info3 = 0 info5 = 10 info6 =  info7 = -2 &lt;/object&gt;
	Line 4: &lt;object name="D"&gt; info1 = 4 info3 = 2 &lt;/object&gt;
</code></pre>
<hr />
<p dir="auto"><strong>Instead</strong> of highlighting the <strong><code>info3</code></strong> zone, <strong>alone</strong>, you may prefer to highlight a <strong>taller</strong> zone ! In that case, with the <strong><code>Regular expression</code></strong> search mode and the <strong><code>Wrap around</code></strong> option <strong>set</strong>, use one of the following regexes :</p>
<p dir="auto"><strong><code>info3 = \d+</code></strong></p>
<p dir="auto"><strong><code>"\w+.+info3</code></strong></p>
<p dir="auto"><strong><code>"\w+.+info3 = \d+</code></strong></p>
<hr />
<p dir="auto"><strong>C)</strong> If you want to get results, like <strong><code>Object X -&gt; info# = #</code></strong>, <strong>without</strong> using the <strong>Find result</strong> panel ( the <strong>Scott</strong> method ) :</p>
<ul>
<li>
<p dir="auto"><strong>Copy</strong> all your file contents in a <strong>new</strong> tab</p>
</li>
<li>
<p dir="auto"><strong>Switch</strong> to that <strong>new</strong> tab</p>
</li>
<li>
<p dir="auto">Open the <strong>Replace</strong> Dialog</p>
</li>
</ul>
<p dir="auto">SEARCH <strong><code>(?s-i)&lt;object name="(\w+)"&gt;[^/]+?(info1 = \d+).*?&lt;/object&gt;|&lt;object.+?&lt;/object&gt;\R</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1Object \1 -&gt; \2</code></strong></p>
<ul>
<li>With the <strong>same</strong> options as <strong>above</strong>, click  on the <strong><code>Replace All</code></strong> button</li>
</ul>
<p dir="auto">You should obtain :</p>
<pre><code class="language-diff">Object A -&gt; info1 = 3
Object B -&gt; info1 = 5
Object D -&gt; info1 = 4
</code></pre>
<p dir="auto">Remarks to <strong>Scott</strong> :</p>
<ul>
<li>
<p dir="auto">Like you, I was searching for a solution and found the <strong>A)</strong> and <strong>B)</strong> solutions, first, because I thought that <strong>Massimo</strong> wanted to use the <strong>Find result</strong> dialog, <strong>exclusively</strong>. I read your solution, and I tried your regex, of course !</p>
</li>
<li>
<p dir="auto">I, then, realized that if some objects do <strong>not</strong> have a <strong>specific</strong> <strong><code>info#</code></strong> value, like in my <strong>sample</strong> text, your regex does <strong>not</strong> delete the corresponding areas <strong>&lt;object name…&lt;/object&gt;</strong> ! Hence, the <strong>second</strong> alternative of my regex <strong><code>&lt;object.+?&lt;/object&gt;\R</code></strong> with the <strong>implicit</strong> <strong><code>(?s)</code></strong> modifier, which is to be <strong>deleted</strong>, in replacement ;-))</p>
</li>
<li>
<p dir="auto">Moreover, this possibility means, also, that the area, between the <strong>object name</strong> and the searched <strong><code>info#</code></strong> must <strong>not</strong> contain any <strong><code>/</code></strong> symbol ! That is to say it must be <strong>enclosed</strong> inside the <strong><code>&lt;object name...&lt;/object&gt;</code></strong> area, of course !</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/31669</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/31669</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 15 Apr 2018 07:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to Find all in current document don&#x27;t provide father object on Sat, 14 Apr 2018 19:52:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/massimo-araldi" aria-label="Profile: Massimo-Araldi">@<bdi>Massimo-Araldi</bdi></a></p>
<p dir="auto">It’s kind of hard to know what you are looking for here.  I mean, we kind-of know, but we can’t read your mind and know what your ultimate end goal is (this happens A LOT with this type of question).  I’m sensing that it will be hard to please you fully with any solution on this…</p>
<p dir="auto">Also, because you didn’t bother to put your sample data into a code-block (where it will be represented verbatim, instead of processed by the markdown engine on this website), maybe your data doesn’t truly look like what a reader here thinks it does…</p>
<p dir="auto">A lot of supposition here…</p>
<p dir="auto">So maybe you are just interested in knowing what the “pairs” are in a concise format…</p>
<p dir="auto">You might try this:</p>
<p dir="auto"><strong>Find what</strong> zone: <code>(?s-i)&lt;object name="([^"]+)"&gt;.*?info1 = (\d+).*?&lt;/object&gt;</code><br />
<strong>Replace with</strong> zone: <code>\1 -&gt; \2</code><br />
<strong>Search mode</strong>: Regular expression<br />
Action: <strong>Replace</strong> one at a time, or <strong>Replace All</strong> (possibly with <strong>Wrap around</strong> ticked)</p>
<p dir="auto">This would change data like you’ve specified:</p>
<pre><code class="language-z">&lt;object name="A"&gt;
info1 = 3
info2 = 5
info3 = 7
&lt;/object&gt;
&lt;object name="B"&gt;
info1 = 5
info2 = 8
info3 = 0
&lt;/object&gt;
&lt;object name="C"&gt;
info1 = 12
info2 = 8
info3 = 0
&lt;/object&gt;
</code></pre>
<p dir="auto">into the “pairs” relation that follows:</p>
<pre><code class="language-z">A -&gt; 3
B -&gt; 5
C -&gt; 12
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/31668</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/31668</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 14 Apr 2018 19:52:39 GMT</pubDate></item></channel></rss>