<?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[Replace all entries in a row]]></title><description><![CDATA[<p dir="auto">Hi everyone, I have a <code>.txt</code> file containing multiple rows and columns. For a particular row, I want to keep the first value unchanged and replace every other value in that row with a fixed number.</p>
<p dir="auto">Example:</p>
<p dir="auto">Original row:<br />
<code>Ns 0 1 2 3 4</code></p>
<p dir="auto">Desired row:<br />
<code>Ns 1 1 1 1 1</code></p>
<p dir="auto">Any suggestions would be appreciated—thanks!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27428/replace-all-entries-in-a-row</link><generator>RSS for Node</generator><lastBuildDate>Thu, 19 Nov 2026 06:03:58 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27428.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Feb 2026 20:58:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replace all entries in a row on Mon, 23 Feb 2026 21:09:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/muhammad-nihal-naseer" aria-label="Profile: Muhammad-Nihal-Naseer">@<bdi>Muhammad-Nihal-Naseer</bdi></a> ,</p>
<p dir="auto">Unfortunately, your example data (both before and after) wasn’t good enough to clarify what you wanted.</p>
<p dir="auto">There are lots of regex that will do what you want on that specific piece of data.  But until you define what you actually want under multiple conditions, it will be impossible to make you happy.</p>
<p dir="auto">For example,</p>
<ul>
<li>Is <code>Ns</code> what causes it to be “a particular row”</li>
<li>Is it possible for there to be “a particular row” that has something other than five numbers</li>
<li>Are all your numbers single digits?  Or can some of them be multiple digits (like <code>Ns 0 11 2 33 4444</code>)?</li>
<li>Are there any spaces before the <code>Ns</code>?</li>
<li>Are those spaces or tabs between columns?</li>
</ul>
<p dir="auto">The best advice for asking for search/replace help is to give a block of data, showing both things that change, and things that should stay the same.</p>
<p dir="auto">For example,</p>
<pre><code class="language-txt">Ms 0 1 2 3 4
Ns 0 1 2 3 4
Ps 0 1 2 3 4
</code></pre>
<p dir="auto">would work (by <em>my</em> definition, based on <em>my</em> interpretation of your incomplete spec) with</p>
<ul>
<li>FIND = <code>^(Ns) \d \d \d \d \d</code></li>
<li>REPLACE = <code>$1 1 1 1 1 1</code></li>
<li>SEARCH MODE = <code>Regular Expression</code></li>
</ul>
<p dir="auto">ending up with</p>
<pre><code class="language-txt">Ms 0 1 2 3 4
Ns 1 1 1 1 1
Ps 0 1 2 3 4
</code></pre>
<p dir="auto">… but it would do nothing to the text</p>
<pre><code class="language-txt">Ms 0 1 2 3 4
Ns 0 11 2 33 4444
Ps 0 1 2 3 4
</code></pre>
<p dir="auto">Assuming the rule is “match a line starting with Ns followed by 5 integers of 1 or more digit each”, the FIND would be <code>^(Ns) \d+ \d+ \d+ \d+ \d+</code> and the REPLACE would be as I described above.  That updated FIND would then turn the “do nothing” text the same way my original did.</p>
<p dir="auto">But it all depends on what your <em>real</em> data looks like.</p>
<p dir="auto">-—</p>
<h3>Useful References</h3>
<ul>
<li><a href="https://community.notepad-plus-plus.org/topic/21965/please-read-before-posting">Please Read Before Posting</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/22022/template-for-search-replace-questions">Template for Search/Replace Questions</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts">Formatting Forum Posts</a></li>
<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/104826</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/104826</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 23 Feb 2026 21:09:28 GMT</pubDate></item></channel></rss>