<?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[Search and Replace for CNC Help Needed]]></title><description><![CDATA[<p dir="auto">Fellow Notepad++ Users,</p>
<p dir="auto">Could you please help me the the following search-and-replace problem I am having?</p>
<p dir="auto">I am writing CNC programs. I modify the output from my CAM system to use a variable feedrate. The characters can be different depending on which system I’m writing for. Typically there are only a few lines that I change manually, but for certain cycles there are thousands of lines.</p>
<p dir="auto">Basically, I need to change <code>F300</code>. to <code>F[#23*300.]</code>, but the F word can have 1-3 digits to the left of the decimal, and 0-2 digits to the right.<br />
With simple Find/Replace I can get everything I need <code>F[#23*300.</code> to <code>F[#23*1.15</code> for example, but I can’t get the closing bracket.</p>
<p dir="auto">Note, I only need to modify the F word, it only occurs at the end of a line.</p>
<p dir="auto">Before data:</p>
<pre><code>G1 Z-.51 Q66.
X1.4004Y.8297Z-.5129F300.
G3X1.4193Y.7497Z-.52I.052J-.03F150.
X1.6025Y.6946I.1832J.277F85.58
X1.6582Y.6993J.3321
X1.7857Y.7497I-.0557J.3274F171.16
X1.8046Y.8295Z-.513I-.0331J.05F300.
G1X1.7857Y.8625Z-.51
X1.3014Q500.
</code></pre>
<p dir="auto">After Data:</p>
<pre><code>G1 Z-.51 Q66.
X1.4004Y.8297Z-.5129F[#23*300.]
G3X1.4193Y.7497Z-.52I.052J-.03F[#23*150.]
X1.6025Y.6946I.1832J.277F[#23*85.58]
X1.6582Y.6993J.3321
X1.7857Y.7497I-.0557J.3274F[#23*171.16]
X1.8046Y.8295Z-.513I-.0331J.05F[#23*300.]
G1X1.7857Y.8625Z-.51
X1.3014Q500.
</code></pre>
<p dir="auto">I did this with the simple Find/Replace and then adding the closing bracket manually.<br />
*Find = <code>F</code><br />
*Replace With = <code>F[#23*</code><br />
*Search Mode = NORMAL<br />
*Dot Matches Newline = NOT CHECKED</p>
<p dir="auto">I did uses Regex with the following search term to Find all of the words I need to modify.</p>
<p dir="auto">*Find = <code>F\d+[.]\d*</code><br />
*Replace With =<br />
*Search Mode = REGULAR EXPRESSION<br />
*Dot Matches Newline = NOT CHECKED</p>
<p dir="auto">Unfortunatley I have exhausted my mental ablities with that and cannot figure out how to do the Replacement</p>
<p dir="auto">Thanks in advance for your help.</p>
<p dir="auto">–<br />
<em>moderator added code markdown around text; please don’t forget to <a href="https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts">use the <code>&lt;/&gt;</code> button to mark example text as “code”</a> and <code>`</code> around inline text like regex, so that characters don’t get changed by the forum</em></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27672/search-and-replace-for-cnc-help-needed</link><generator>RSS for Node</generator><lastBuildDate>Wed, 30 Sep 2026 16:46:40 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27672.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Sep 2026 12:47:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Search and Replace for CNC Help Needed on Wed, 30 Sep 2026 15:22:44 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-adamczyk" aria-label="Profile: Paul-Adamczyk">@<bdi>Paul-Adamczyk</bdi></a> <a href="/post/106447">said</a>:</p>
<p dir="auto">Still much to learn.</p>
</blockquote>
<p dir="auto">Useful References:</p>
<ul>
<li><a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ Online User Manual: Searching/Regex</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find other regular expressions (regex) documentation</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/106448</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106448</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 30 Sep 2026 15:22:44 GMT</pubDate></item><item><title><![CDATA[Reply to Search and Replace for CNC Help Needed on Wed, 30 Sep 2026 15:07: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></p>
<p dir="auto">That worked great!<br />
Seems there is a whole level I was not aware of.<br />
Still much to learn.</p>
<p dir="auto">Thanks for your help!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106447</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106447</guid><dc:creator><![CDATA[Paul Adamczyk]]></dc:creator><pubDate>Wed, 30 Sep 2026 15:07:34 GMT</pubDate></item><item><title><![CDATA[Reply to Search and Replace for CNC Help Needed on Wed, 30 Sep 2026 15:01:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-adamczyk" aria-label="Profile: Paul-Adamczyk">@<bdi>Paul-Adamczyk</bdi></a> <a href="/post/106445">said</a>:</p>
<p dir="auto">Your second was on the right track:</p>
<p dir="auto">FIND = <code>F(\d+[.]\d*)</code><br />
REPLACE = <code>F[#23*$1]</code><br />
SEARCH MODE = Regular Expression<br />
DOT MATCHES = not checked</p>
<p dir="auto">The parentheses in the FIND put the number into capture group #1<br />
The <code>$1</code> in the replacement says “use the contents of capture group #1”</p>
<p dir="auto">(Personally, I would use <code>\.</code> instead of <code>[.]</code> to match a literal dot character, but your notation works, so I left it the way you understand it)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106446</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106446</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 30 Sep 2026 15:01:20 GMT</pubDate></item></channel></rss>