<?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[I need to replace some numbers....]]></title><description><![CDATA[<p dir="auto">Hi guys, I need to replace some numbers: specifically I need to replace the 6 digit bold numbers with 6 ZEROES only at the SPECIFIC lines: (lines that begin with “Vertex”)<br />
The random 6 digit bold numbers appear randomly ONLY after the “<strong>.</strong>”<br />
They are always 6 digit and always random.<br />
Put in other words: I need to make sure that on every line that begins with “Vertex” after the DOT I have 6 ZEROES. Always.<br />
Thanx in advance!</p>
<p dir="auto">Begin PolyList<br />
Begin Polygon<br />
Origin   -00128.000000,-00128.000000,-00128.000000<br />
Normal   -00001.000000,+00000.000000,+00000.000000<br />
TextureU +00000.000000,+00001.000000,+00000.000000<br />
TextureV +00000.000000,+00000.000000,-00001.000000<br />
Vertex   -00128.<strong>768546</strong>,-00128.000000,-00128.<strong>766453</strong><br />
Vertex   -00128.000000,-00128.000000,+00128.000000<br />
Vertex   -00128.000000,+00131.<strong>756453</strong>,+00128.000000<br />
Vertex   -00128.000000,+00131.000000,-00128.000000<br />
End Polygon</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18175/i-need-to-replace-some-numbers</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 20:17:29 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18175.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Sep 2019 13:53:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I need to replace some numbers.... on Wed, 04 Sep 2019 23:44:09 GMT]]></title><description><![CDATA[<p dir="auto">But at this point, I’m not sure I want to run the risk of you blaming us anymore for your problem.  Hopefully this post will show you what happened.</p>
<p dir="auto">When I started with</p>
<pre><code>Begin PolyList
Begin Polygon
Origin -00128.000000,-00128.000000,-00128.000000
Normal -00001.000000,+00000.000000,+00000.000000
TextureU +00000.000000,+00001.000000,+00000.000000
TextureV +00000.000000,+00000.000000,-00001.000000
Vertex   -00128.768546,-00128.000000,-00128.766453
Vertex   -00128.000000,-00128.000000,+00128.000000
Vertex   -00128.000000,+00131.756453,+00128.000000
Vertex   -00128.000000,+00131.000000,-00128.000000
End Polygon
</code></pre>
<p dir="auto">with your three pesky spaces (or without, because it doesn’t affect the regex <strong>at all</strong>), and run <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: ekopalypse">@<bdi>ekopalypse</bdi></a>’s regex once with REPLACE ALL, it fixes two of the three instances:</p>
<pre><code>Begin PolyList
Begin Polygon
Origin -00128.000000,-00128.000000,-00128.000000
Normal -00001.000000,+00000.000000,+00000.000000
TextureU +00000.000000,+00001.000000,+00000.000000
TextureV +00000.000000,+00000.000000,-00001.000000
Vertex   -00128.768546,-00128.000000,-00128.000000
Vertex   -00128.000000,-00128.000000,+00128.000000
Vertex   -00128.000000,+00131.000000,+00128.000000
Vertex   -00128.000000,+00131.000000,-00128.000000
End Polygon
</code></pre>
<p dir="auto">Then I run it a second time, and it fixes the third instance.</p>
<pre><code>Begin PolyList
Begin Polygon
Origin -00128.000000,-00128.000000,-00128.000000
Normal -00001.000000,+00000.000000,+00000.000000
TextureU +00000.000000,+00001.000000,+00000.000000
TextureV +00000.000000,+00000.000000,-00001.000000
Vertex   -00128.000000,-00128.000000,-00128.000000
Vertex   -00128.000000,-00128.000000,+00128.000000
Vertex   -00128.000000,+00131.000000,+00128.000000
Vertex   -00128.000000,+00131.000000,-00128.000000
End Polygon
</code></pre>
<p dir="auto">The reasons this happens is because of the way the regex engine works inside of Notepad++: The first match found the start of the line, followed by Vertex, followed by as many characters as it could, until it hit the literal period that wasn’t before 6 zeroes.  That means in <code>-00128.768546,-00128.000000,-00128.766453</code> that it gobbled up all the characters until it found <code>766453</code> (the second set of non-zero decimal-fraction digits)… that’s then the fraction that it replaced with <code>000000</code> on that row.  But at that point, the search cursor had moved beyond that line, so it didn’t see that the line still matches the regex.  Hence it left that line as</p>
<pre><code>Vertex   -00128.768546,-00128.000000,-00128.000000
</code></pre>
<p dir="auto">When you run the regex a second time, it gets rid of the second match earlier in the line.</p>
<p dir="auto">If <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> had used a non-greedy regex <code>^Vertex.*?\.\K(?!0{6})(\d{6})</code> (the extra <code>?</code> makes it non-greedy), then it would have fixed the <code>768546</code> on the first run of the regex, and <code>766453</code> on the second.</p>
<p dir="auto">Either way, just run the regex more than once, and it will work for you.  If there are three numbers possible on each line (and given “polygon” and “vertex”, I am assuming that those are 3d coordinates, so three seems a reasonable max-per-line), then you should only have to run the regex a maximum of 3 times to get all the replacements done.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46812</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46812</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 04 Sep 2019 23:44:09 GMT</pubDate></item><item><title><![CDATA[Reply to I need to replace some numbers.... on Wed, 04 Sep 2019 23:26:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-mcdoe" aria-label="Profile: John-McDoe">@<bdi>John-McDoe</bdi></a> said:</p>
<blockquote>
<p dir="auto">I have given all the information that is required in my previous post</p>
</blockquote>
<p dir="auto">Where “all the information” doesn’t including showing exactly what you tried (you make us do the work of “three spaces” because you have shown yourself unwilling to follow simple instructions for quoting exact text), doesn’t include showing us what you got when you tried it, doesn’t include showing why you think the result was wrong.  That seems like “I have given you the bare minimum of information, which isn’t actually enough to solve my problem, and then blame you when the free help doesn’t work exactly the way I want it to”.</p>
<p dir="auto">If that’s how you want to come across, leave things as they are.  If you want to come across as someone who is willing to learn, and who is willing to make an effort, and who wants help rather than just demanding a solution, I would suggest adding information and rephrasing things.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46810</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46810</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 04 Sep 2019 23:26:49 GMT</pubDate></item><item><title><![CDATA[Reply to I need to replace some numbers.... on Wed, 04 Sep 2019 23:13:09 GMT]]></title><description><![CDATA[<p dir="auto">HI again. I did everything that <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a>  said correct. I tripple checked everything.</p>
<p dir="auto"><strong>In the end, I did a macro, that does the job for me, it worked</strong>, but I’d like to be able to do it using the way he described too.</p>
<p dir="auto">I have given all the information that is required in my previous post, just note that after “Vertex” there are always 3 spaces, not 1.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46807</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46807</guid><dc:creator><![CDATA[John McDoe]]></dc:creator><pubDate>Wed, 04 Sep 2019 23:13:09 GMT</pubDate></item><item><title><![CDATA[Reply to I need to replace some numbers.... on Wed, 04 Sep 2019 18:41:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-mcdoe" aria-label="Profile: John-McDoe">@<bdi>John-McDoe</bdi></a> said:</p>
<blockquote>
<p dir="auto">Can someone give me a working solution?</p>
</blockquote>
<p dir="auto">Can you post some data that you are sure is correct?  People tend to lose interest after a few posts where people can’t do this…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46803</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46803</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 04 Sep 2019 18:41:06 GMT</pubDate></item><item><title><![CDATA[Reply to I need to replace some numbers.... on Wed, 04 Sep 2019 18:38:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-mcdoe" aria-label="Profile: John-McDoe">@<bdi>John-McDoe</bdi></a> said:</p>
<blockquote>
<p dir="auto">The one posted by <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> does not work.</p>
</blockquote>
<p dir="auto">Maybe not.  But it’s an excellent starting point.  You could choose to study the docs (see below, and the <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">link</a> Eko posted), and then try to modify <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a>’s regex to fit your needs.  If you cannot get it to work, you can show us what you tried (and why you think that should have worked), what you got, and what you expect.</p>
<p dir="auto">Show some effort, and you’ll get lots of help.  Don’t show any effort, and you’ll probably eventually get the answer anyway, but will have to wait longer, and will probably use up any free goodwill you may have started with.</p>
<p dir="auto">-----</p>
<h4>Please Read And Understand The Following</h4>
<p dir="auto">FYI:</p>
<blockquote>
<p dir="auto">This forum is formatted using <a href="https://daringfireball.net/projects/markdown/syntax" rel="nofollow ugc">Markdown</a>, with a help link buried on the little grey <code>?</code> in the COMPOSE window/pane when writing your post. For more about how to use Markdown in this forum, please see <a href="https://notepad-plus-plus.org/community/topic/14262/how-to-markdown-code-on-this-forum/4" rel="nofollow ugc">@Scott-Sumner’s post in the “how to markdown code on this forum” topic</a>, and my updates <a href="https://notepad-plus-plus.org/community/topic/14262/how-to-markdown-code-on-this-forum/9" rel="nofollow ugc">near the end</a>. It is very important that you use these formatting tips – using single backtick marks around small snippets, and using code-quoting for pasting multiple lines from your example data files – because otherwise, the forum will change normal quotes (<code>""</code>) to curly “smart” quotes (<code>“”</code>), will change hyphens to dashes, will sometimes hide asterisks (or if your text is <code>c:\folder\*.txt</code>, it will show up as <code>c:\folder*.txt</code>, missing the backslash). If you want to clearly communicate your text data to us, you <em>need</em> to properly format it.  That topic also explains how to embed images by uploading them to a public server like <a href="http://imgur.com" rel="nofollow ugc">imgur.com</a>, and embedding them using the syntax <code>![](http://i.imgur.com/QTHZysa.png)</code></p>
</blockquote>
<blockquote>
<p dir="auto">If you have further search-and-replace (“matching”, “marking”, “bookmarking”, regular expression, “regex”) needs, study <a href="https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentation" rel="nofollow ugc">this FAQ</a> and the documentation it points to, especially <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">this</a>. Before asking a new regex question, understand that for future requests, many of us will expect you to show what data you have (exactly), what data you want (exactly), what regex you already tried (to show that you’re showing effort), why you thought that regex would work (to prove it wasn’t just something randomly typed), and what data you’re getting with an explanation of why that result is wrong. When you show that effort, you’ll see us bend over backward to get things working for you. If you need help formatting, see the paragraph above.</p>
</blockquote>
<blockquote>
<p dir="auto">Please note that for all regex and related queries, it is best if you are explicit about what needs to match, <em>and</em> what <em>shouldn’t</em> match, and have multiple examples of both in your example dataset. Often, what <em>shouldn’t match</em> helps define the regular expression as much or more than what <em>should match</em>.</p>
</blockquote>
]]></description><link>https://community.notepad-plus-plus.org/post/46801</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46801</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 04 Sep 2019 18:38:38 GMT</pubDate></item><item><title><![CDATA[Reply to I need to replace some numbers.... on Wed, 04 Sep 2019 17:58:41 GMT]]></title><description><![CDATA[<p dir="auto">Can someone give me a working solution? The one posted by <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> does not work.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46796</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46796</guid><dc:creator><![CDATA[John McDoe]]></dc:creator><pubDate>Wed, 04 Sep 2019 17:58:41 GMT</pubDate></item><item><title><![CDATA[Reply to I need to replace some numbers.... on Wed, 04 Sep 2019 14:42:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-mcdoe" aria-label="Profile: John-McDoe">@<bdi>John-McDoe</bdi></a></p>
<p dir="auto">They disappeared because this forum uses Markdown syntax in posts.  If you want to show data without markdown messing with it, do a line like this before and after your data: <code>~~~</code></p>
<p dir="auto">Thus:</p>
<p dir="auto"><code>~~~</code><br />
<code>hello  there</code><br />
<code>~~~</code></p>
<p dir="auto">will look like this when posting:</p>
<pre><code>hello  there
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/46782</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46782</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 04 Sep 2019 14:42:13 GMT</pubDate></item><item><title><![CDATA[Reply to I need to replace some numbers.... on Wed, 04 Sep 2019 13:15:39 GMT]]></title><description><![CDATA[<p dir="auto">Hi, thank you but its not working because I made a mistake and skipped some spaces:</p>
<p dir="auto">This is how the line (a single line for example only) looks:</p>
<p dir="auto">Vertex   +02096.560547,+00774.871582,+00078.723633</p>
<p dir="auto">There are 3 <strong>spaces</strong> after the word “Vertex” that somehow disappeared.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46780</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46780</guid><dc:creator><![CDATA[John McDoe]]></dc:creator><pubDate>Wed, 04 Sep 2019 13:15:39 GMT</pubDate></item><item><title><![CDATA[Reply to I need to replace some numbers.... on Mon, 02 Sep 2019 14:20:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-mcdoe" aria-label="Profile: John-McDoe">@<bdi>John-McDoe</bdi></a></p>
<p dir="auto">find what:<code>^Vertex.*\.\K(?!0{6})(\d{6})</code><br />
replace with:<code>000000</code></p>
<p dir="auto">Note, because of the <strong>\K</strong> usage you need to press <strong>replace all</strong>, <em>replace</em> doesn’T work in this case <strong>and</strong> you need to keep press <strong>replace all</strong>  unless you receive that<br />
nothing was replaced anymore.</p>
<p dir="auto">If you want to learn more about the regex checkout the <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc"><strong>NEW NPP MANUAL SITE</strong></a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46742</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46742</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 02 Sep 2019 14:20:56 GMT</pubDate></item></channel></rss>