<?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[How can we reverse words in a row]]></title><description><![CDATA[<p dir="auto">Hello, I’ve a list of words organized this way:</p>
<p dir="auto">word1|word2<br />
word3|word4</p>
<p dir="auto">I want to reverse rows this way:</p>
<p dir="auto">word2|word1<br />
word4|word3</p>
<p dir="auto">Can we do this through notepad++? If yes, could you please tell me how?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20990/how-can-we-reverse-words-in-a-row</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 20:13:47 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20990.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Apr 2021 12:54:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How can we reverse words in a row on Mon, 05 Apr 2021 16:59:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mou-nir" aria-label="Profile: Mou-Nir">@<bdi>Mou-Nir</bdi></a> said in <a href="/post/64653">How can we reverse words in a row</a>:</p>
<blockquote>
<p dir="auto">Thank you sir peter for the help, but I’ve faced a small issue which is as follow:</p>
</blockquote>
<p dir="auto">You said “word”.  You should not be surprised that it didn’t work for multiple “words” on each side of the <code>|</code>.</p>
<p dir="auto">Here’s another freebie – but it’s the last from me.  The quality of replies is only as good as the quality of your question.  If you don’t understand your data well enough to explain it correctly to us, there is no way we would be expected to guess it.</p>
<ul>
<li>FIND = <code>(?-s)^(.*?)\|(.*?)$</code></li>
</ul>
<p dir="auto">Everything else from my previous solution remains the same.</p>
<p dir="auto">This will swap <em>everything</em> on the left of the first <code>|</code> on a line with everything to the right of the first <code>|</code> on the line.</p>
<p dir="auto">And, as Alan said, it is difficult to hit a moving target.  I have re-aimed once already, and am not likely to do so again.</p>
<p dir="auto">If you want to do more fancy search-and-replace in the future, your best bet is going to be to study the documentation I’ve already linked.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64659</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64659</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 05 Apr 2021 16:59:22 GMT</pubDate></item><item><title><![CDATA[Reply to How can we reverse words in a row on Mon, 05 Apr 2021 14:52:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mou-nir" aria-label="Profile: Mou-Nir">@<bdi>Mou-Nir</bdi></a> said in <a href="/post/64655">How can we reverse words in a row</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> worst support ever</p>
</blockquote>
<p dir="auto">So, first, there are no “supporters” here in an official sense.<br />
So a comment like “worst support ever” does not apply. :-)</p>
<p dir="auto">Second, if you want something, you should really think about it (what it actually is) before you post.  Now, I realize that that is not always a reasonable thing to accomplish…</p>
<p dir="auto">However, you provided some data:</p>
<pre><code class="language-z">word1|word2
word3|word4
</code></pre>
<p dir="auto">and your desired result:</p>
<pre><code class="language-z">word2|word1
word4|word3
</code></pre>
<p dir="auto">…which, at first look, is a great thing to have done.</p>
<p dir="auto">And Peter provided a solution.</p>
<blockquote>
<p dir="auto">how could I know that I would face that issue after trying his code?</p>
</blockquote>
<p dir="auto">But now you say your data is <em>different</em> than you first represented??<br />
Well, to that I have to comment: “Worst question-asker ever!”<br />
All right, that’s just a joke, but…</p>
<blockquote>
<p dir="auto">word1 word1|word2</p>
</blockquote>
<p dir="auto">Even your changed specification of your data is vague…<br />
Peter could develop another solution to handle that, and you will say “wait…wait…hold on a minute…I really have data like: __________”</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64657</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64657</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 05 Apr 2021 14:52:50 GMT</pubDate></item><item><title><![CDATA[Reply to How can we reverse words in a row on Mon, 05 Apr 2021 14:50:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mou-nir" aria-label="Profile: Mou-Nir">@<bdi>Mou-Nir</bdi></a> said in <a href="/post/64649">How can we reverse words in a row</a>:</p>
<blockquote>
<p dir="auto">Can we do this through notepad++?</p>
</blockquote>
<p dir="auto">You can also do it much quicker in a spreadsheet.  Open the text based delimited file with pipe<code>|</code> as the delimiter and then cut and paste columns to your heart’s delight.</p>
<p dir="auto">Sometimes we have to use the right tool for the right job and column manipulation is done much easier and “natively” in a spreadsheet application versus a text editor.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64656</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64656</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Mon, 05 Apr 2021 14:50:55 GMT</pubDate></item><item><title><![CDATA[Reply to How can we reverse words in a row on Mon, 05 Apr 2021 14:41:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> are you serious? man, how could I know that I would face that issue after trying his code?</p>
<p dir="auto">I am here asking for help, It’d better to ask it else where.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> worst support ever</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64655</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64655</guid><dc:creator><![CDATA[Mou Nir]]></dc:creator><pubDate>Mon, 05 Apr 2021 14:41:00 GMT</pubDate></item><item><title><![CDATA[Reply to How can we reverse words in a row on Mon, 05 Apr 2021 14:15:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mou-nir" aria-label="Profile: Mou-Nir">@<bdi>Mou-Nir</bdi></a></p>
<p dir="auto">I think you got what you asked for the first time around, with Peter’s response.<br />
If you wanted something different, perhaps you should have asked for that.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64654</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64654</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 05 Apr 2021 14:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to How can we reverse words in a row on Mon, 05 Apr 2021 13:51:50 GMT]]></title><description><![CDATA[<p dir="auto">Thank you sir peter for the help, but I’ve faced a small issue which is as follow:</p>
<p dir="auto">for instance, word1 word1|word2  , only word1 which close to the separator (|) gets selected by this code (\w+)|</p>
<p dir="auto">please, what should I do in such situation? Thanks again</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64653</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64653</guid><dc:creator><![CDATA[Mou Nir]]></dc:creator><pubDate>Mon, 05 Apr 2021 13:51:50 GMT</pubDate></item><item><title><![CDATA[Reply to How can we reverse words in a row on Mon, 05 Apr 2021 13:06:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mou-nir" aria-label="Profile: Mou-Nir">@<bdi>Mou-Nir</bdi></a></p>
<blockquote>
<p dir="auto">Can we do this through notepad++?</p>
</blockquote>
<p dir="auto">Yes, using the <a href="https://npp-user-manual.org/docs/searching/#capture-groups-and-backreferences" rel="nofollow ugc">numbered capture group</a> feature.</p>
<ul>
<li>FIND = <code>(\w+)\|(\w+)</code> – store the word before the <code>|</code> as group#1, and after as group#2</li>
<li>REPLACE = <code>${2}|${1}</code> – in the replacement, use group#2 first, then <code>|</code>, then group#1</li>
<li>Search Mode = regular expression</li>
</ul>
<p dir="auto">-—</p>
<p dir="auto"><em>Do you want regex search/replace help?  Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you.  All example text should be marked as literal text using the <code>&lt;/&gt;</code> toolbar button or manual <a href="https://community.notepad-plus-plus.org/topic/14262/how-to-markdown-code-on-this-forum/4">Markdown syntax</a>. To make <code>regex in red</code> (and so they keep their special characters like *), use backticks, like <code>`^.*?blah.*?\z`</code>. Screenshots can be pasted from the clipboard to your post using <code>Ctrl+V</code> to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have <strong>and</strong> the text you want to get from that data; include examples of things that <strong>should match</strong> and be transformed, <strong>and</strong> things that <strong>don’t match</strong> and should be left alone; show <strong>edge cases</strong> and make sure you examples are as <strong>varied</strong> as your real data.  Show the regex you already tried, <strong>and why</strong> you thought it should work; tell us what’s wrong with what you <strong>do</strong> get. Read the official <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">NPP Searching / Regex docs</a> and the forum’s <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a>. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/64651</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64651</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 05 Apr 2021 13:06:15 GMT</pubDate></item></channel></rss>