<?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[Appending with numbered lines in xml]]></title><description><![CDATA[<p dir="auto">Hi I was hoping someone could tell me an easy way of adding numbers in sequence into an existing document.<br />
For example I have over 600 lines of data and want to add a line between every 2 lines to easily see some coordinates.<br />
Here is what I currently have:</p>
<pre><code>&lt;!--							--&gt;
	&lt;group name="BetterClutterCutter1x1" pos="4557.200684 6.081481 2434.070313" rpy="-0.000000 -0.000000 108.946159" a="-18.9462"/&gt;
	&lt;group name="BetterClutterCutter1x1" pos="4447.911133 6.435289 2471.539551" rpy="-0.000000 -0.000000 -71.058342" a="161.058"/&gt;
	&lt;!--							--&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5660.784668 54.345013 2303.892334" rpy="-0.000000 -0.000000 -76.362091" a="166.362"/&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5702.687988 53.958931 2332.832764" rpy="-0.000000 -0.000000 167.341461" a="-77.3415"/&gt;
	&lt;!--							--&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5775.109375 62.346703 2471.519775" rpy="-0.000000 -0.000000 151.500793" a="-61.5008"/&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5730.605469 62.313519 2468.265625" rpy="-0.000000 -0.000000 1.907229" a="88.0928"/&gt;
	&lt;!--							--&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5695.575684 70.593521 2573.979004" rpy="-0.000000 -0.000000 -178.875153" a="-91.1248"/&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5695.410645 70.044113 2533.210938" rpy="-0.000000 -0.000000 -88.224052" a="178.224"/&gt;
	
</code></pre>
<p dir="auto">And here is what I need:</p>
<pre><code>&lt;!--							1--&gt;
	&lt;group name="BetterClutterCutter1x1" pos="4557.200684 6.081481 2434.070313" rpy="-0.000000 -0.000000 108.946159" a="-18.9462"/&gt;
	&lt;group name="BetterClutterCutter1x1" pos="4447.911133 6.435289 2471.539551" rpy="-0.000000 -0.000000 -71.058342" a="161.058"/&gt;
	&lt;!--							2--&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5660.784668 54.345013 2303.892334" rpy="-0.000000 -0.000000 -76.362091" a="166.362"/&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5702.687988 53.958931 2332.832764" rpy="-0.000000 -0.000000 167.341461" a="-77.3415"/&gt;
	&lt;!--							3--&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5775.109375 62.346703 2471.519775" rpy="-0.000000 -0.000000 151.500793" a="-61.5008"/&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5730.605469 62.313519 2468.265625" rpy="-0.000000 -0.000000 1.907229" a="88.0928"/&gt;
	&lt;!--							4--&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5695.575684 70.593521 2573.979004" rpy="-0.000000 -0.000000 -178.875153" a="-91.1248"/&gt;
	&lt;group name="BetterClutterCutter1x1" pos="5695.410645 70.044113 2533.210938" rpy="-0.000000 -0.000000 -88.224052" a="178.224"/&gt;
	
</code></pre>
<p dir="auto">It doesn’t have to be exactly like that but some sort of easy to read numbers that are commented out, which is what the &lt;!-- --&gt; is for.<br />
Any help much appreciated!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22395/appending-with-numbered-lines-in-xml</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 22:52:04 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22395.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Jan 2022 03:54:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Appending with numbered lines in xml on Wed, 19 Jan 2022 14:15:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/damien-moate" aria-label="Profile: damien-moate">@<bdi>damien-moate</bdi></a> ,</p>
<p dir="auto">Thanks for the before/after example; it helps us help you.</p>
<p dir="auto">The search engine (Find/Replace dialog) does not know how to count, so it cannot be done solely with find/replace.</p>
<p dir="auto">However, there are a couple of ways of doing it inside Notepad++, if you’re willing to use a plugin, or a multi-step process.</p>
<p dir="auto">If you like programming/scripting, you can use the PythonScript or similar plugins; there are examples of similar activities if you search the forum for <code>add_1</code></p>
<p dir="auto">However, if you really have the <code>&lt;!-- --&gt;</code> comment lines every third line, as shown in your example, I would do the following:</p>
<ol>
<li>FIND = <code>\R(?!\h*&lt;!--)</code>, REPLACE = <code>☺</code>, SEARCH MODE = Regular Expression
<ul>
<li>This will condense each group of 3 lines into one long line.</li>
<li>I picked <code>☺</code> because that’s not likely in your document already, and it will make the final step really easy</li>
</ul>
</li>
<li>If the first line is really indented differently than the others, as you’ve shown, then you will want to indent the first line to match.</li>
<li>Use Alt+drag next to the <code>--&gt;</code> on each line to “column select”:<br />
<img src="/assets/uploads/files/1642601549113-5cce2e32-7c36-4667-8ee4-f3fbb7924dd8-image.png" alt="5cce2e32-7c36-4667-8ee4-f3fbb7924dd8-image.png" class=" img-fluid img-markdown" /></li>
<li><a href="https://npp-user-manual.org/docs/editing/#edit-menu" rel="nofollow ugc"><strong>Edit &gt; Column Editor</strong></a>, click <strong>⦿ Number to Insert</strong>, <strong>Initial Number</strong> = <code>1</code>, <strong>Increase By</strong> = <code>1</code>, <strong>OK</strong><br />
<img src="/assets/uploads/files/1642601416695-6f5896ec-a00e-4d1b-9896-2490e866ddce-image.png" alt="6f5896ec-a00e-4d1b-9896-2490e866ddce-image.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1642601570201-3030c347-959c-4467-9a0b-608d8759d9ee-image.png" alt="3030c347-959c-4467-9a0b-608d8759d9ee-image.png" class=" img-fluid img-markdown" /></li>
<li>FIND = <code>☺</code>, REPLACE = <code>\r\n</code>, SEARCH MODE = Regular Expression<br />
<img src="/assets/uploads/files/1642601641979-1859ed77-ecff-472b-a6b3-cd98d2251171-image.png" alt="1859ed77-ecff-472b-a6b3-cd98d2251171-image.png" class=" img-fluid img-markdown" /></li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/73057</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73057</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 19 Jan 2022 14:15:02 GMT</pubDate></item></channel></rss>