<?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[Select by columns?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have sometimes text from application logs. The lines are  starting with a time stamp. To remove irritating information I’d like to remove the first twenty characters of each line. So I’m searching for the possibility to select by columns.<br />
Does anyone know on how to select by columns?<br />
Is there maybe a short cut for this too?</p>
<p dir="auto">Thank you in advance!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/137/select-by-columns</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Jul 2026 15:46:16 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/137.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Jul 2015 12:48:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Select by columns? on Fri, 29 Jan 2016 23:26:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> Good one! It’s a bit confusing, and it took me a few tries to get it right, but for selecting a column of data in 17,000 lines it was the only way to go!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/13672</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/13672</guid><dc:creator><![CDATA[Freon Sandoz]]></dc:creator><pubDate>Fri, 29 Jan 2016 23:26:38 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Sat, 18 Jul 2015 12:19:39 GMT]]></title><description><![CDATA[<p dir="auto">guy038,</p>
<p dir="auto">Nice diligence on the regex issue.  Good information.  I think I’ve got to go with favoring the first group of editors that behave the same way with Replace and RepaceAll.  For myself, often I do a regex search and replace and hit Replace for the first few matches (confirming to myself that I’ve got the regex correct), then switch to ReplaceAll to finish out the file.  I’d be very disappointed to have Replace and ReplaceAll work differently in this situation!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/503</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/503</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 18 Jul 2015 12:19:39 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Tue, 21 Jul 2015 09:26:59 GMT]]></title><description><![CDATA[<p dir="auto">Hi <strong>Scott</strong>,</p>
<p dir="auto">Concerning point <strong>#3</strong> of my previous post, I did some tests with some other <strong>code/text</strong> editors. For <strong>six</strong> of them, which could handle <strong>regular</strong> expressions ( even basic ones ! ), I, always, did the <strong>same</strong> simple <strong>S/R</strong> :</p>
<p dir="auto">SEARCH <strong><code>^...</code></strong></p>
<p dir="auto">REPLACE <strong><code>Empty</code></strong></p>
<p dir="auto">I distinguished <strong>three</strong> different behaviours :</p>
<ul>
<li>
<p dir="auto">The editors <strong>Notepad++</strong>, <strong>SCiTE</strong>, and <strong>SynWrite</strong> replace <strong>all</strong> sequences of <strong>3</strong> characters in <strong>each</strong> line, with <strong>both</strong>, the <strong>Replace</strong> function and the <strong>Replace All</strong> function</p>
</li>
<li>
<p dir="auto">The editors <strong>Notepad2</strong>, <strong>EditPad</strong> and <strong>gVim</strong> replace <strong>all</strong> sequences of <strong>3</strong> characters in <strong>each</strong> line, with the <strong>Replace</strong> function <em><strong>BUT</strong>, change the <strong>first three</strong> characters, in <strong>each</strong> line, ONLY, if the <strong>Replace All</strong> function is used</em></p>
</li>
<li>
<p dir="auto">The editor <strong>PSPad</strong> replace the <strong>first three</strong> characters, in <strong>each</strong> line, ONLY, with <strong>both</strong>, the <strong>Replace</strong> function and the <strong>Replace All</strong> function</p>
</li>
</ul>
<p dir="auto">After reflection, I think that the <strong>second</strong> behaviour ( <strong>Notepad2</strong>, <strong>EditPad</strong> or <strong>gVim</strong> ) would be the best, as the <strong>Replace</strong> and <strong>Replace All</strong> results, with the <strong>obvious</strong> search syntax <strong><code>^...</code></strong>, are different, although both <strong>logical</strong></p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">For instance, with the <strong>gVim</strong> editor :</p>
<p dir="auto">The command <strong><code>:s/^...//cg</code></strong> acts as <strong>Notepad++</strong> and delete <strong>every</strong> block of <strong>three</strong> characters, in the <strong>same</strong> line, before moving to the <strong>next</strong> line</p>
<p dir="auto">The command <strong><code>:%s/^...//g</code></strong> acts like <strong>EditPad</strong>, <strong>Notepad2</strong> or <strong>PSPad</strong> and delete, ONLY, the <strong>first three</strong> characters of <strong>each</strong> line</p>
]]></description><link>https://community.notepad-plus-plus.org/post/502</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/502</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 21 Jul 2015 09:26:59 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Wed, 15 Jul 2015 00:13:08 GMT]]></title><description><![CDATA[<p dir="auto">I’ll call an end to the point #3 discussion, as I think speculating about the behavior of other editors really isn’t what this community forum is about.  Sorry about getting too far off the Notepad++ track there!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/419</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/419</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 15 Jul 2015 00:13:08 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Tue, 14 Jul 2015 23:59:10 GMT]]></title><description><![CDATA[<p dir="auto">I totally understand what you are saying about point #3 and the regexs, but I’m still confused about the logic other editors use.  You didn’t comment on that, and while the information you did provide is good, I still don’t know what to think about how the non-N++ editors do it.  Maybe if you include ^ or $ in your regex in those editors’ replace functions, all you get is a one-chance-per-existing-line match capability?  Perhaps N++ gives one more flexibility, but after years of using an editor that is different, I am finding it difficult to untrain my way of thinking about it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/418</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/418</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 14 Jul 2015 23:59:10 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Tue, 14 Jul 2015 23:54:03 GMT]]></title><description><![CDATA[<p dir="auto">I think the point I was trying to make about point #2 is that an Alt+click on a line <em>after</em> the official line ending allows the cursor to be moved beyond the actual line ending, <em>without</em> having the Scintilla virtual space stuff enabled.  A neat trick for someone that doesn’t want the free-cursoring behavior all the time, but only occasionally.  Otherwise, your information about the virtual spacing was solid for those that aren’t aware.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/417</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/417</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 14 Jul 2015 23:54:03 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Thu, 16 Jul 2015 01:33:30 GMT]]></title><description><![CDATA[<p dir="auto">Hello <strong>Scott</strong>,</p>
<p dir="auto">About point <strong>#1</strong> :</p>
<p dir="auto">I don’t think that I ever used the <strong>rectangular</strong> selection in the <strong>Search Results</strong> panel ( or, may be, without realizing that I did it ! ) Despite of the small bug when the <strong>last</strong> line is shorter than others, it can be intersesting sometimes :-)</p>
<p dir="auto">BTW, did you notice that you can just copy the found lines, <strong>without</strong> their line numbers ( <strong><code>Line xxx:</code></strong> ), since the N++ <strong>v6.7.9</strong> ?</p>
<p dir="auto">So, when your search, displays some lines, from <strong>several</strong> files, and that you click, either :</p>
<ul>
<li>On the <strong>title</strong> of a specific <code>Search "....." (xx hits in yy files)</code></li>
<li>On an <strong>absolute pathname</strong> of a specific file</li>
<li>On a <strong>previous</strong> selection of some lines, even on <strong>two or more</strong> files</li>
<li>On a specific line</li>
</ul>
<p dir="auto">Then, after <strong>right clicking</strong>, in the search results window, on the option <strong>Copy</strong>, you get, <strong>accordingly</strong>, in the clipboard  :</p>
<ul>
<li>All the lines found, in the <strong>current</strong> <code>Search "....." (xx hits in yy files)</code></li>
<li>All the lines, found in that <strong>specific</strong> file</li>
<li>All the lines, of the selection ( <strong>+ 1</strong> or, when you select lines, end with <strong>Shift + Left arrow</strong>, to copy the <strong>exact</strong> number )</li>
<li>That specific line</li>
</ul>
<p dir="auto">without the leading text <strong><code>Line xxx:</code></strong></p>
<p dir="auto">The nice thing is that if you make  a [ rectangular ] selection and that you press, <strong>first</strong>, on <strong>CTRL + C</strong> ( instead of the <strong>right</strong> click on the <strong>copy</strong> option ), you’ll simply get, in the clipboard, a <strong>“hard”</strong> copy of the selection, <em>which will include the <strong>leading line numbers</strong></em>, of the search results panel :-)</p>
<hr />
<p dir="auto">About point <strong>#2</strong> :</p>
<p dir="auto"><strong>Scott</strong>, you’re talking about the <strong>Virtual space</strong> capability of <strong>Scintilla</strong>. See further information, from the link below :</p>
<p dir="auto"><a href="http://www.scintilla.org/ScintillaDoc.html#MultipleSelectionAndVirtualSpace" rel="nofollow ugc">http://www.scintilla.org/ScintillaDoc.html#MultipleSelectionAndVirtualSpace</a></p>
<p dir="auto">The function call used is <code>SCI_SETVIRTUALSPACEOPTIONS (int Virtual Space)</code>, of number_id <code>2596</code></p>
<p dir="auto">The argument can take values <strong>0</strong> to <strong>3</strong>. The <strong>Scintilla</strong> documentation speaks of the <strong>two bit</strong> flags <strong><code>SCVS_RECTANGULARSELECTION=1</code></strong> and <strong><code>SCVS_USERACCESSIBLE=2</code></strong>, which can be set <strong>independently</strong>.</p>
<p dir="auto">Except for the value <strong>0</strong>, which means <strong>NO virtual space</strong> at all, you could test the other cases. To do so :</p>
<ul>
<li>
<p dir="auto">Open the <strong>shortcuts.xml</strong> file, <em>with an <strong>OTHER</strong> editor</em></p>
</li>
<li>
<p dir="auto">Add the text below, in the <strong>macros</strong> section :</p>
<p dir="auto">&lt;Macro name=“VIRTUEL Space, after End of Line, Activated” Ctrl=“no” Alt=“yes” Shift=“no” Key=“32”&gt;<br />
&lt;Action type=“0” message=“2596” wParam=“3” lParam=“0” sParam=“” /&gt;<br />
&lt;/Macro&gt;<br />
&lt;Macro name=“VIRTUEL Space, after End of Line, Desactivated” Ctrl=“no” Alt=“yes” Shift=“yes” Key=“32”&gt;<br />
&lt;Action type=“0” message=“2596” wParam=“0” lParam=“0” sParam=“” /&gt;<br />
&lt;/Macro&gt;</p>
</li>
<li>
<p dir="auto">Save it and restart N++</p>
</li>
</ul>
<p dir="auto">You may test the values <strong>1</strong> and <strong>2</strong>, changing <strong>wParam</strong>, in the <strong>first</strong> macro :-)</p>
<hr />
<p dir="auto">About point <strong>#3</strong></p>
<p dir="auto">There a <strong>logical</strong> explanation about the <strong>odd</strong> N++'s behaviour, for the search/replacement :</p>
<p dir="auto">SEARCH  <strong><code>^.{n}</code></strong><br />
REPLACE  <strong>Empty</strong></p>
<p dir="auto">When you perform a search <strong>ONLY</strong>, once the <strong>n first</strong> characters, of a line, are selected, the cursor is on column <strong>n+1</strong>. Obviously, to get a <strong>second</strong> match, due to the anchor <strong><code>^</code></strong>, the regex engine must go forward, first, till an other <strong>beginning</strong> of line =&gt; You do get, successively, a string, of <strong>n</strong> characters long, located, at <strong>beginning</strong> of lines</p>
<p dir="auto">Right. Now, when you perform a <strong>replacement</strong>, the situation is <strong>completely</strong> different ! Indeed, when the <strong>n</strong> characters, at the <strong>beginning</strong> of a line are <strong>deleted</strong>, as the replace field is <strong>empty</strong>, <em>the cursor is STILL located at the <strong>beginning</strong> of that line</em> !</p>
<p dir="auto">Therefore, the regex engine selects the <strong>following n</strong> characters, in the <strong>same</strong> line, delete them and so on… till the current line contains <strong>less than n</strong> characters. This time, as the syntax <strong><code>.{n}</code></strong> can’t be satisfied, the regex engine normally matches the <strong>n first</strong> characters, from the <strong>next</strong> line ! Et voilà</p>
<p dir="auto">It just like if you would have followed the steps, below :</p>
<ul>
<li>Search for the regex <strong><code>^.{n}</code></strong></li>
<li><strong>Manually</strong>, delete these <strong>n</strong> selected characters</li>
<li>Search <strong>again</strong> for the regex <strong><code>^.{n}</code></strong></li>
<li><strong>Manually</strong>, delete the <strong>n other</strong> selected characters</li>
</ul>
<p dir="auto">and so on…</p>
<p dir="auto">The <strong>alternative</strong> search/replacement, that <strong>correctly</strong> work , are :</p>
<p dir="auto">SEARCH  <strong><code>(?-s)^.{n}(.*)</code></strong><br />
REPLACE  <strong><code>\1</code></strong></p>
<p dir="auto">SEARCH <strong><code>(?-s)^.{n}(.)?</code></strong><br />
REPLACE <strong><code>\1</code></strong></p>
<p dir="auto">SEARCH  <strong><code>(?-s)^.{1,n}(.*)</code></strong><br />
REPLACE <strong><code>\1</code></strong></p>
<p dir="auto">SEARCH <strong><code>(?-s)^.{1,n}(.)?</code></strong><br />
REPLACE <strong><code>\1</code></strong></p>
<p dir="auto">Why are these regexes <strong>OK</strong> ? It’s just because, for a <strong>complete</strong> match, the regex engine must, also, match the <strong>remainder</strong> of the current line or <strong>one</strong> character, after the <strong>n</strong> characters, which are to be <strong>deleted</strong>. Obviously, in <strong>both</strong> cases, the cursor location, AFTER rewriting the <strong>group 1</strong>, is <strong>NOT</strong> at <strong>beginning</strong> of the current line. So, the regex engine needs to skip to the <strong>beginning</strong> of the <strong>next</strong> line, for an other match !</p>
<p dir="auto">NOTES :</p>
<p dir="auto">The <strong><code>(?-s)</code></strong> modifier ensure that the <strong>dot</strong> matches <strong>standard</strong> characters, ONLY, whatever the state of the <strong>.matches newline</strong> option</p>
<p dir="auto">The <strong>first two</strong> S/R are equivalent but DON’T change the lines of <strong>less than n</strong> characters</p>
<p dir="auto">The <strong>last two</strong> S/R are equivalent and delete ALL characters between columns <strong>1</strong> and <strong>n</strong> , included, on any line</p>
<p dir="auto">REMARK :</p>
<p dir="auto">Luckily, the <strong>two</strong> opposite S/R, below, works fine :</p>
<p dir="auto">SEARCH  <strong><code>.{n}$</code></strong><br />
REPLACE <strong>Empty</strong></p>
<p dir="auto">SEARCH  <strong><code>.{1,n}$</code></strong><br />
REPLACE <strong>Empty</strong></p>
<p dir="auto">Again, when the <strong>last n</strong> characters of a line are <strong>deleted</strong>, the cursor is located between the <strong>last</strong> character of this line and a <strong>End of Line</strong> character. Then, the <strong>only</strong> way to match, again, the regex <strong><code>.{n}$</code></strong>, for instance, is to skip to the <strong>n</strong> characters of a <strong>next</strong> line, which contains, at least, <strong>n</strong> characters !</p>
<p dir="auto">To <strong>test</strong> these different regexes and observe the <strong>results</strong> of replacement, just type the text, below, in a <strong>new</strong> tab and <em>replace the variable <strong>n</strong> by the value <strong>5</strong></em>, for instance :</p>
<pre><code>1
12
123
1234
12345
123456
1234567
12345678
123456789
1234567890
</code></pre>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/416</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/416</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 16 Jul 2015 01:33:30 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Tue, 14 Jul 2015 11:42:16 GMT]]></title><description><![CDATA[<p dir="auto">guy038,</p>
<p dir="auto">You are exactly right with the mouse operation–I like it!  I’m so used to entering column mode with Shift+Alt+(cursor-move) that I neglected to remember the mouse and its possible elegance for the solution to the original problem here, in conjunction with Begin/End Select.</p>
<p dir="auto">As a side note (#1), were you aware that column mode also works in the “Search Results” window?  Unfortunately, I think there is a bug with it in the SR window:  If the last line you are trying to column-select is shorter than the lines above, you will be limited to the length of the last line for your whole block!  Note that this comment is made only considering Alt+mouse selection of columnar text; with keyboard Shift+Alt+cursor things are really odd in the SR window!</p>
<p dir="auto">As side note (#2), and maybe getting really off track now!, I find it really interesting that I can Alt+Click in the main editor window to put the cursor/caret BEYOND a line’s current ending point (normally N++ disallows cursoring beyond the current end-of-line).  I know that there is a Scintilla command I can execute to free the cursor so that it can normally move beyond end-of-line (which I like being able to do!), but I’ve found it causes some strange behavior sometimes (semi-random indenting, random extra line insertion) when Enter is pressed to goto/create the next line, so I quit using that Scintilla extension.</p>
<p dir="auto">Now, on to what I really wanted to say, a question of my own (let’s call it #3):  I notice with the regex solution I proposed to the original problem, N++ works differently than other editors I’ve used, and I’d like to understand why and if there is a way to have N++ work more like I’m used to.  Originally I was going to propose to Search for ^.{20} and Replace with nothing.  In other editors (PSPad, MultiEdit) this works as intended to chop the first 20 characters off each line’s beginning, moving to the next line after each chop.  In N++, however, I notice that it will chop the first 20, and then keep chopping 20 off the current line, as long as the current line is still &gt;= 20 characters long.  I found that I had to propose a more complicated regex search/repl expression than I wanted to to make it work to solve the original problem.  It seems like the other editors are more “line-oriented” when it comes to regex processing, but I’m not sure how to explain what I mean by that.  Please help me understand this behavior a little better.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/395</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/395</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 14 Jul 2015 11:42:16 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Tue, 14 Jul 2015 01:03:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello <strong>Scott</strong> and <strong>All</strong>,</p>
<p dir="auto">Oh, I didn’t know that the <strong>Begin/End Select</strong> feature works, also, with a <strong>Column Mode/rectangular selection</strong> !</p>
<p dir="auto">After some tests, I don’t even think that the <strong>Alt + Shift + Down arrow</strong> is necessary. So, the <strong>general</strong> method, of using the <strong>Begin/End Select</strong> feature, seems to be :</p>
<ul>
<li>
<p dir="auto"><strong>Left</strong> mouse click at the <strong>beginning</strong> of the wanted selection</p>
</li>
<li>
<p dir="auto">Select the <strong>Begin/End Select</strong> command ( The menu option is automatically <strong>checked</strong> )</p>
</li>
<li>
<p dir="auto">Go to the location where the wanted selection must <strong>stop</strong></p>
</li>
<li>
<p dir="auto">Move the cursor to that <strong>second</strong> and final location, with :</p>
<ul>
<li>A <strong>left</strong> click to set the future <em><strong>normal</strong> selection</em></li>
<li>A hit on the <strong>ALT</strong> key and a <strong>left</strong> click, simultaneously, to set the future <em><strong>column mode</strong> selection</em></li>
</ul>
</li>
<li>
<p dir="auto">Select, again, the <strong>Begin/End Select</strong> command ( The menu option is automatically <strong>unchecked</strong> ), to generate the <strong>appropriate</strong> selection</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/386</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/386</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 14 Jul 2015 01:03:26 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Mon, 13 Jul 2015 13:50:21 GMT]]></title><description><![CDATA[<p dir="auto">Thomas,</p>
<p dir="auto">Your own solution can be unwieldy if you have a lot of lines to deal with.  Thus I would suggest two alternatives.</p>
<p dir="auto">The first is to use a regular expression Replace:<br />
Find what box: (?-s)^.{20}(.*)$<br />
Replace with box: \1<br />
Search Mode: Regular expression<br />
After setting that up, be at the top of your intended file and press the Replace All button.<br />
All of the undesired text is now gone.</p>
<p dir="auto">The second alternative is to use the Begin/End Select feature with column mode:<br />
Have the cursor in column 1 at the top of your intended file.<br />
Start the “Begin/End Select” command via the Edit menu.<br />
Go to the next to last line in your file, put the cursor in column 21.<br />
Enter column mode by pressing Shift+Alt+DownArrow.  This moves your cursor to the last line.<br />
Stop the Begin/End Select (item is currently checked) via the Edit menu.<br />
All of your undesired text is now highlighted, awaiting your delete command.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/369</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/369</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Mon, 13 Jul 2015 13:50:21 GMT</pubDate></item><item><title><![CDATA[Reply to Select by columns? on Mon, 13 Jul 2015 12:55:50 GMT]]></title><description><![CDATA[<p dir="auto">Ah, I found the “Edit | Column Mode…” entry that shows the required short cut as a tip!<br />
I just have to add the “Alt” key for selecting in columns…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/367</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/367</guid><dc:creator><![CDATA[Thomas Schulz]]></dc:creator><pubDate>Mon, 13 Jul 2015 12:55:50 GMT</pubDate></item></channel></rss>