<?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 want every 2 lines to have specific text added at the end of each of them.]]></title><description><![CDATA[<p dir="auto">for example lets say i have the following text</p>
<pre><code>line1
line2
line3
line4
line5
line6
</code></pre>
<p dir="auto">I want this text to become</p>
<pre><code>line1.mp4
line2.srt
line3.mp4
line4.srt
line5.mp4
line6.srt
</code></pre>
<p dir="auto">ive searched for a bit and couldnt fine a solution to do this specifically, thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25500/i-want-every-2-lines-to-have-specific-text-added-at-the-end-of-each-of-them</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 05:19:52 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25500.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Feb 2024 21:14:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I want every 2 lines to have specific text added at the end of each of them. on Tue, 20 Feb 2024 22:04:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mkupper" aria-label="Profile: mkupper">@<bdi>mkupper</bdi></a> this worked great, thanks!<br />
<img src="/assets/uploads/files/1708466659315-9cdd4325-e8f6-40fa-9a85-d684b18cb503-image.png" alt="9cdd4325-e8f6-40fa-9a85-d684b18cb503-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/93056</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/93056</guid><dc:creator><![CDATA[GabrielP]]></dc:creator><pubDate>Tue, 20 Feb 2024 22:04:20 GMT</pubDate></item><item><title><![CDATA[Reply to I want every 2 lines to have specific text added at the end of each of them. on Tue, 20 Feb 2024 21:59:17 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> is there no way to add text to odd lines and then another text to even lines?</p>
<p dir="auto">right now im trying this,</p>
<p dir="auto">(?-s)^(.+\R)(.+\R?)<br />
\1.mp4 &amp; \2.srt</p>
<p dir="auto"><img src="/assets/uploads/files/1708465896301-455b977d-ba26-487b-b542-d40031f79a22-image.png" alt="455b977d-ba26-487b-b542-d40031f79a22-image.png" class=" img-fluid img-markdown" /><br />
<a href="https://community.notepad-plus-plus.org/topic/23052/add-text-to-even-lines/4">which i saw here</a></p>
<p dir="auto">but unfortunately my text goes from this<br />
(im replacing ONLY the first 2 lines btw, to show you that it ends up affecting the 3rd line too)</p>
<pre><code>1 - Aula de apresentação
1 - Aula de apresentação
1 - Políticas Públicas: Definições e Componentes
1 - Políticas Públicas: Definições e Componentes
</code></pre>
<p dir="auto">to this</p>
<pre><code>1 - Aula de apresentação
.mp4 &amp; 1 - Aula de apresentação
.srt1 - Políticas Públicas: Definições e Componentes
1 - Políticas Públicas: Definições e Componentes
</code></pre>
<p dir="auto">when if im only replacing the first 2 lines, it just want it to become this</p>
<pre><code>1 - Aula de apresentação.mp4
1 - Aula de apresentação.srt
1 - Políticas Públicas: Definições e Componentes
1 - Políticas Públicas: Definições e Componentes
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/93055</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/93055</guid><dc:creator><![CDATA[GabrielP]]></dc:creator><pubDate>Tue, 20 Feb 2024 21:59:17 GMT</pubDate></item><item><title><![CDATA[Reply to I want every 2 lines to have specific text added at the end of each of them. on Tue, 20 Feb 2024 21:50:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gabrielp" aria-label="Profile: GabrielP">@<bdi>GabrielP</bdi></a> I would use a search/replace for lines ending with odd/even values. It’s low tech but is safe and works in a predictable and understandable way.</p>
<p dir="auto"><strong>Search:</strong> <code>([02468])$</code><br />
<strong>Replace:</strong> <code>\1.srt</code><br />
and<br />
<strong>Search:</strong> <code>([13579])$</code><br />
<strong>Replace:</strong> <code>\1.mp4</code></p>
<p dir="auto">The above makes the assumption that your data has numbers at the ends of them.  If your actual data is more like.</p>
<pre><code class="language-txt">safe
and
works
in
a
predictable
and
understandable
way
</code></pre>
<p dir="auto">then I still like do do it in several safe passes. For example - this will join pairs of lines using <code>~</code> as the separator.<br />
<strong>Search:</strong> <code>^(.+)\R(.+)$</code><br />
<strong>Replace:</strong> <code>\1~\2</code><br />
I do a search/replace all and see that the results look good.  The last line is just the word <code>way</code> meaning it’s not part of a pair. With real data I would think about how that should be dealt with but for now, I don’t care.</p>
<p dir="auto">Once the data looks safe it’s easy to then<br />
<strong>Search:</strong> <code>$</code><br />
<strong>Replace:</strong> <code>.srt</code><br />
and<br />
<strong>Search:</strong> <code>~</code><br />
<strong>Replace:</strong> <code>.mp4\r\n</code></p>
<p dir="auto">The <code>~</code> can be any character as long as it’s something that is not used in your file. You can use anything such as <code>\t</code> tab, <code>\x00</code> NUL, etc.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/93054</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/93054</guid><dc:creator><![CDATA[mkupper]]></dc:creator><pubDate>Tue, 20 Feb 2024 21:50:46 GMT</pubDate></item><item><title><![CDATA[Reply to I want every 2 lines to have specific text added at the end of each of them. on Tue, 20 Feb 2024 21:37:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gabrielp" aria-label="Profile: GabrielP">@<bdi>GabrielP</bdi></a> said in <a href="/post/93048">I want every 2 lines to have specific text added at the end of each of them.</a>:</p>
<blockquote>
<p dir="auto">ive searched for a bit and couldnt fine a solution to do this specifically</p>
</blockquote>
<p dir="auto">Specifically, no, because no one has your exact text.  Expecting any search on the internet to give you exactly what you want without you having to interpret it for your specific circumstance is a bit <a href="https://www.maryrosewood.com/the-incorrigible-children-of-ashton-place#:~:text=diversion%20Penelope%20needs.-,Optoomuchstic,-as%20ever%2C%20Penelope" title="To borrow my favorite neologism, from the The Incorrigible Children of Ashton Place" rel="nofollow ugc">optoomuchstic</a>.</p>
<p dir="auto">But this is the kind of situation that the <a href="https://community.notepad-plus-plus.org/topic/23170/faq-can-i-do-a-mathematical-replacement/2#:~:text=REPLACE%20FROM%20A%20SMALL%20LIST%20OF%20VALUES">REPLACE FROM A SMALL LIST OF VALUES</a> section of our FAQ was meant to cover: in general, it shows you how to replace matched text with a small list of values.  In your specific situation, you would want to search for <code>$</code> (match at the end of the line, so the replacement is just appended without deleting anything), and your list of replacements would be <code>['.mp4', '.srt']</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/93051</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/93051</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 20 Feb 2024 21:37:16 GMT</pubDate></item></channel></rss>