<?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 Find and Replace a value bigger than 100(Float)]]></title><description><![CDATA[<p dir="auto">I want to find and replace a value greater than 100.0 with 1.0?</p>
<p dir="auto">2 Lines.</p>
<pre><code>      "Value": 100.0,
      "Name": "Intensity",
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/26508/how-to-find-and-replace-a-value-bigger-than-100-float</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 05:11:04 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26508.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 28 Dec 2024 14:42:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Tue, 31 Dec 2024 16:54:25 GMT]]></title><description><![CDATA[<p dir="auto">FWIW, <a href="https://github.com/molsonkiko/JsonToolsNppPlugin" rel="nofollow ugc">JsonTools v8.3.1.3</a> (see instructions for downloading an unreleased version) now has a function that would allow JsonTools to solve this problem without knowing the full structure of the JSON document.</p>
<p dir="auto"><code>recurse_until(@, and(@.Value &gt; 100, @.Name == Intensity))[:].Value = 1.0</code> will convert all the <code>Value</code> instances greater than 100 where the <code>Name</code> was <code>Intensity</code> to <code>1.0</code>.</p>
<p dir="auto">For example, in <code>{"foo": [{"Value": 101, "Name": "Intensity"}, {"Name": "Blah", "Value": 200}], "bar": {"Name": "Intensity", "Value": 60}}</code>, running this query would return <code>{"foo": [{"Value": 1.0, "Name": "Intensity"}, {"Name": "Blah", "Value": 200}], "bar": {"Name": "Intensity", "Value": 60}}</code></p>
<p dir="auto">I should note that the <code>recurse_until</code> method is <em>very slow compared to other JsonTools functions</em> because it can potentially throw and catch an exception for every node in a document, so I do not endorse this approach for very large documents.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98881</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98881</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Tue, 31 Dec 2024 16:54:25 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 22:49:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/google-sync" aria-label="Profile: Google-Sync">@<bdi>Google-Sync</bdi></a> said in <a href="/post/98810">How to Find and Replace a value bigger than 100(Float)</a>:</p>
<blockquote>
<p dir="auto">Now, if I want to replace something greater than 25.0, how do I put it? Just so I can try to understand how this language works.</p>
</blockquote>
<p dir="auto">That’s trickier. The expression given took advantage of the fact that if there are no leading zeros, any number with three or more digits before the decimal point must be greater than or equal to 100. This bit:<br />
<strong><code>\d\d\d[.\d]*</code></strong><br />
matches three digits, followed by zero or more digits or decimal points.</p>
<p dir="auto">To match 25 or greater, we’d need to break that down into numbers with three or more digits, numbers with two digits where the first one is 3-9 and numbers with two digits where the first one is 2 and the second one is 5-9. That could look like this:</p>
<p dir="auto"><strong><code>(\d\d\d+|[3-9]\d|2[5-9])[.\d]*</code></strong></p>
<p dir="auto">making the whole thing look like this:</p>
<p dir="auto"><strong><code>(?&lt;="Value")\s*:\s*(\d\d\d+|[3-9]\d|2[5-9])[.\d]*(?=\s*,\s*"Name"\s*:\s*"Intensity")</code></strong></p>
<p dir="auto">Now, if you really mean <em>greater than</em> 25 (not greater than or equal to), you’d need to separate out the 25 case as well and make sure it is followed by a decimal point and a string of digits at least one of which is not 0.</p>
<p dir="auto">For references to how regular expressions work, see <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">the Notepad++ User Manual section on regular expressions</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98813</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98813</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sat, 28 Dec 2024 22:49:18 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 22:49:17 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Now, if I want to replace something greater than 25.0, how do I put it? Just so I can try to understand how this language works.</p>
</blockquote>
<p dir="auto">That one is harder.  For the &gt;= 100.0 case, that could be shortcut by saying “any number with three or more digits before the decimal”, which is how <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> crafted a non-mathematical regex to do it.</p>
<p dir="auto">Using the ideas that <a class="plugin-mentions-user plugin-mentions-a" href="/user/mkupper" aria-label="Profile: mkupper">@<bdi>mkupper</bdi></a> suggested, you could craft a regex for choosing a different threshold, but every threshold would take a lot of manual crafting, which is why I made the blanket statement that NPP cannot do it natively, because it cannot do it generically.</p>
<p dir="auto">However, using one of the plugins suggested in the FAQ, you could actually include a mathematical comparison in the search expression, which you <strong>cannot</strong> do in Notepad++'s native regex searches.  This is why I recommended the FAQ, as it explains all that, and gives examples of how to do similar actions in three different plugins.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98812</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98812</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 28 Dec 2024 22:49:17 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 22:53:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a> said in <a href="/post/98809">How to Find and Replace a value bigger than 100(Float)</a>:</p>
<blockquote>
<p dir="auto">Since <a class="plugin-mentions-user plugin-mentions-a" href="/user/google-sync" aria-label="Profile: Google-Sync">@<bdi>Google-Sync</bdi></a> still hasn’t explained what they wan</p>
</blockquote>
<p dir="auto">Sorry, until a user gets upvotes, their replies are at the mercy of moderator availability… That user had tried to reply in a more timely manner, as can be seen by where it got inserted…</p>
<p dir="auto">I highly recommend to all people answering, that if you think the OP has put in a reasonable effort and doesn’t appear to be a spammer, and you want them to be able to reply to your requests for clarification, that you make sure that they get at least one upvote…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98811</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98811</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 28 Dec 2024 22:53:29 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 22:10:04 GMT]]></title><description><![CDATA[<p dir="auto">Since <a class="plugin-mentions-user plugin-mentions-a" href="/user/google-sync" aria-label="Profile: Google-Sync">@<bdi>Google-Sync</bdi></a> still hasn’t explained what they want, I guess I’ll start ranting about JSON and what I mean when I ask about <em><code>the structure of your JSON</code>.</em></p>
<p dir="auto">Consider this JSON object:</p>
<pre><code class="language-json">{
    "foo": {"value": 1, "name": "foo"},
    "bar_array": [{"value": 1, "name": "foo"}]
}
</code></pre>
<p dir="auto">With a JSON parser, it is quite easy to differentiate between the two instances of <code>{"value": 1, "name": "foo"}</code> in that object, but I, as an outsider trying to guess how to help the person working with this JSON, need to see this entire JSON object, not just a small subset of it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98809</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98809</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Sat, 28 Dec 2024 22:10:04 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 21:20:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/google-sync" aria-label="Profile: Google-Sync">@<bdi>Google-Sync</bdi></a> said in <a href="/post/98801">How to Find and Replace a value bigger than 100(Float)</a>:</p>
<blockquote>
<p dir="auto">“Value”: 100.0,</p>
</blockquote>
<p dir="auto">There is insufficient information in your post to generate a regular expression that will reliably match “value bigger than 100(Float).”</p>
<p dir="auto">Specifically, you have not shown when values less than or equal to “100(Float)” are in your data. You have also not shown how values exactly equal to “100(Float)” may be formatted in your data. You have also not shown how values larger or bigger than “100(Float)” may be formatted in your data.</p>
<p dir="auto">Computers and regular expressions have an annoying habit of doing exactly what you tell them to do, which is often not exactly what you wanted.</p>
<p dir="auto">As you did not provide much in the way of example data or possible <a href="https://en.wikipedia.org/wiki/Edge_case" rel="nofollow ugc">edge conditions</a> I will take a <strong>big guess</strong> at what your data may have and for now will only focus on the <code>"Value": 100.0,</code> part of the problem.</p>
<p dir="auto">Let’s start with <code>values that are a tiny bit larger than 100 which I'll match with </code>“Value”: 100.0*[1-9][0-9]*,<code> That will match on</code>"Value": 100.00000000000001,<code>for example as it's a number that is</code>0.00000000000001` bigger than 100.</p>
<p dir="auto">Match on 101 to 109 using <code>"Value": 10[1-9](?:\.[0-9]*)?,</code></p>
<p dir="auto">Match on 110 to 199 using <code>"Value": 1[1-9][0-9](?:\.[0-9]*)?,</code></p>
<p dir="auto">Match on 1000 or more using <code>"Value": [1-9][0-9]{3,}(?:\.[0-9]*)?,</code></p>
<p dir="auto">Now we have identified four regexp that will match values that are a fraction larger than 100, that are ones larger than 100, that are tens larger than 100, and finally that are four or more digits which are numbers that must be larger than 100. Let’s combine all four and we have <code>"Value": (?:100\.0*[1-9][0-9]*|(?:10[1-9]|1[1-9][0-9]|[1-9][0-9]{3,})(?:\.[0-9]*)?),</code>  That can be painful for humans to read and so I’ll spread it out over several lines.</p>
<pre><code class="language-txt">(?x)"Value":\x20
(?:
	100\.0*[1-9][0-9]*|		# Match 100. followed by at least one non-zero digit after the decimal point
(?:
	10[1-9]|				# Match 101 to 109
	1[1-9][0-9]|			# Match 110 to 199
	[1-9][0-9]{3,}			# Match 1000 or more
)(?:\.[0-9]*)?				# Allow for the values 101 to 1000 or more to have a decimal point followed by zero or more digits
),
</code></pre>
<p dir="auto">The human readable version works in Notepad++ if you want to experiment with it. Keep in mind that if you want to match a space then you need to use <code>\x20</code> as I did in the first line to match the space that is after <code>"Value":</code></p>
<p dir="auto">While you can’t do math or math style comparisons in regular expressions you can somewhat simulate the desired behavior using what I showed above.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98808</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98808</guid><dc:creator><![CDATA[mkupper]]></dc:creator><pubDate>Sat, 28 Dec 2024 21:20:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 20:39:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a></p>
<p dir="auto">It worked flawless, Thank u.</p>
<p dir="auto">Now, if I want to replace something greater than 25.0, how do I put it? Just so I can try to understand how this language works.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98810</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98810</guid><dc:creator><![CDATA[Google Sync]]></dc:creator><pubDate>Sat, 28 Dec 2024 20:39:41 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 18:59:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/google-sync" aria-label="Profile: Google-Sync">@<bdi>Google-Sync</bdi></a> said in <a href="/post/98801">How to Find and Replace a value bigger than 100(Float)</a>:</p>
<blockquote>
<p dir="auto">I want to find and replace a value greater than 100.0 with 1.0?</p>
<p dir="auto">2 Lines.</p>
<pre><code>      "Value": 100.0,
      "Name": "Intensity",
</code></pre>
</blockquote>
<p dir="auto">If:</p>
<ul>
<li>the structure is always as you’ve shown;</li>
<li>“Value” and “Name” always occur next to each other, in that order;</li>
<li>the values never have leading zeros;</li>
<li>you meant greater than <em>or equal to</em> 100;</li>
</ul>
<p dir="auto">then you can do this:</p>
<p dir="auto">From the main menu, select <strong>Search</strong> | <strong>Replace…</strong>; in the dialog, enter:</p>
<p dir="auto"><strong>Find what: <code>(?&lt;="Value")\s*:\s*\d\d\d[.\d]*(?=\s*,\s*"Name"\s*:\s*"Intensity")</code></strong><br />
<strong>Replace with: <code>: 1.0</code></strong><br />
<strong>Match case:</strong> <em>checked or not, depending on whether case matters in your file</em><br />
<strong>Wrap around:</strong> <em>checked</em><br />
<strong>Search mode: Regular expression</strong></p>
<p dir="auto">and then click <strong>Replace All</strong>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98807</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98807</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sat, 28 Dec 2024 18:59:54 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 18:08:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/google-sync" aria-label="Profile: Google-Sync">@<bdi>Google-Sync</bdi></a></p>
<blockquote>
<p dir="auto">Give me this error when i try to replace:…</p>
</blockquote>
<p dir="auto">Yeah, there was a typo in my query, but it doesn’t matter because my query would not be adequately restrictive.</p>
<blockquote>
<p dir="auto">I want to reduce the intensity of point light in a map i’m working on, so it needs to have the “intensity” when I search to replace, otherwise it will overwrite other important values.</p>
</blockquote>
<p dir="auto">I still don’t understand what you’re going for, but <strong>at this point I no longer think this is an appropriate task for a Notepad++ plugin, and you need to figure out how to do this in a programming language.</strong></p>
]]></description><link>https://community.notepad-plus-plus.org/post/98806</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98806</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Sat, 28 Dec 2024 18:08:19 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 17:45:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a></p>
<p dir="auto">This is a .umap (Unreal Engine 4) file extracted to .json. I want to reduce the intensity of point light in a map i’m working on, so it needs to have the “intensity” when I search to replace, otherwise it will overwrite other important values.</p>
<p dir="auto">Give me this error when i try to replace:</p>
<p dir="auto">“Runtime error while executing query<br />
While executing query @…Value[and(is_num(@), @ &gt; 100)] = 1.0, encountered runtime error:<br />
System.ArgumentException: Cannot compare JArrays or JObjects<br />
at JSON_Tools.JSON_Tools.JNode.CompareTo(Object other)<br />
at JSON_Tools.JSON_Tools.JNode.CompareTo(Object other)<br />
at JSON_Tools.JSON_Tools.Binop.GreaterThan(JNode a, JNode b)<br />
at System.Linq.Enumerable.WhereSelectListIterator<code>2.MoveNext() at System.Collections.Generic.List</code>1…ctor(IEnumerable<code>1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable</code>1 source)<br />
at JSON_Tools.JSON_Tools.Binop.BinopJsonScalar(JNode left, JNode right)<br />
at JSON_Tools.JSON_Tools.Binop.BinopTwoJsons(JNode left, JNode right)<br />
at JSON_Tools.JSON_Tools.ArgFunction.And(List<code>1 args) at JSON_Tools.JSON_Tools.IndexerFunc.&lt;&gt;c__DisplayClass6_0.&lt;&lt;ApplyBooleanIndex&gt;g__boolIdxrFunc|0&gt;d.MoveNext() at JSON_Tools.JSON_Tools.RemesParser.&lt;ApplyIndexerList&gt;g__idxrListFunc|16_0(JNode obj, List</code>1 idxrs, Int32 ii)<br />
at JSON_Tools.JSON_Tools.RemesParser.&lt;ApplyIndexerList&gt;g__idxrListFunc|16_0(JNode obj, List`1 idxrs, Int32 ii)<br />
at JSON_Tools.JSON_Tools.JMutator.Operate(JNode inp)<br />
at JSON_Tools.Forms.TreeViewer.SubmitQueryButton_Click(Object sender, EventArgs e)”</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98805</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98805</guid><dc:creator><![CDATA[Google Sync]]></dc:creator><pubDate>Sat, 28 Dec 2024 17:45:58 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 17:05:59 GMT]]></title><description><![CDATA[<p dir="auto">This is pretty easy with <a href="https://github.com/molsonkiko/JsonToolsNppPlugin" rel="nofollow ugc">JsonTools</a>, which I would recommend over other mathematical replacement tools because you appear to be working with JSON.</p>
<p dir="auto">If you want to replace all values greater than 100 that are associated with the <code>Value</code> key, no matter where that <code>Value</code> key is in the document, the <a href="https://github.com/molsonkiko/JsonToolsNppPlugin/blob/main/docs/README.md#remespath" rel="nofollow ugc">RemesPath query</a> <code>@..Value[and(is_num(@), @ &gt; 100)] = 1.0</code> will do the job. If that’s not quite what you’re looking for, you need to tell us more about the structure of your JSON.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98804</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98804</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Sat, 28 Dec 2024 17:05:59 GMT</pubDate></item><item><title><![CDATA[Reply to How to Find and Replace a value bigger than 100(Float) on Sat, 28 Dec 2024 15:50:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/google-sync" aria-label="Profile: Google-Sync">@<bdi>Google-Sync</bdi></a> ,</p>
<p dir="auto">Notepad++ cannot do that natively.</p>
<p dir="auto">However, please read our <a href="https://community.notepad-plus-plus.org/topic/23170/faq-can-i-do-a-mathematical-replacement">Mathematical Replacement FAQ</a>, as that will explain a few paths you can try.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98803</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98803</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 28 Dec 2024 15:50:12 GMT</pubDate></item></channel></rss>