<?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[Removing Unwanted Columns]]></title><description><![CDATA[<p dir="auto">Hi all, I have a file with four columns of text such as;</p>
<p dir="auto">Server-name  IP-address  Date Time<br />
example-svr  10.10.1.0  2018-01-01 12:44:42.350</p>
<p dir="auto">I only want to retain column two with the IP address.<br />
How can I do that?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/15057/removing-unwanted-columns</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 11:51:11 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/15057.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Jan 2018 15:43:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Removing Unwanted Columns on Thu, 11 Jan 2018 20:13:25 GMT]]></title><description><![CDATA[<p dir="auto">Inspired by the “excel” suggestion (or otherwise “favorite open-source spreadsheet”), but wanting to replicate that inside NPP itself: use the suggestions from <a href="https://notepad-plus-plus.org/community/topic/14717/column-aligning-jagged-data" rel="nofollow ugc">another recent thread</a> to get them into aligned colums in NPP, then use the column-mode editing to cut out whichever columns aren’t wanted (or to re-order columns, or similar).  :-)</p>
<p dir="auto">But since the OP is probably long gone by now… I probably shouldn’t spend anymore brain-time on this one. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29379</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29379</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 11 Jan 2018 20:13:25 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Thu, 11 Jan 2018 19:55:28 GMT]]></title><description><![CDATA[<p dir="auto">lol, yeah I noticed that… it’s all good! I’ve been doing this kind of stuff for years… I was thinking of a script and then this popped into my head. I was in the same mindset. :-) I can’t even think of all the times I did things in an over complicated way because I had been coding… One could even make a macro to do it…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29378</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29378</guid><dc:creator><![CDATA[Chip Cooper]]></dc:creator><pubDate>Thu, 11 Jan 2018 19:55:28 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Thu, 11 Jan 2018 19:48:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chip-cooper" aria-label="Profile: Chip-Cooper">@<bdi>Chip-Cooper</bdi></a></p>
<p dir="auto">I call a <em><strong>FOUL</strong></em> on Mr. Chip!  Nobody here wants an over-complicated <strong>Excel</strong> solution–Ugh!  The best we tolerate is an over-complicated (within) Notepad++ (or its plugins) solution!  And we’ve certainly got those in abundance!  :-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29377</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29377</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Thu, 11 Jan 2018 19:48:36 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Thu, 11 Jan 2018 19:44:58 GMT]]></title><description><![CDATA[<p dir="auto">I’d simply replace all the &lt;sp&gt; with “,”&lt;sp&gt;, then save as .csv file, and import into excel. delete to two columns you don’t want, and export it again as a .csv file and rename it to .txt. Of course, if you don’t have excel, you can’t do this…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29375</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29375</guid><dc:creator><![CDATA[Chip Cooper]]></dc:creator><pubDate>Thu, 11 Jan 2018 19:44:58 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Thu, 11 Jan 2018 14:47:46 GMT]]></title><description><![CDATA[<p dir="auto">I was curious, so spent the 10 minutes experimenting and researching.</p>
<p dir="auto">For npp_exec:</p>
<pre><code>cmd /c for /f "usebackq tokens=2" %a in ("$(FULL_CURRENT_PATH)") do @echo %a
</code></pre>
<p dir="auto">for run-menu:</p>
<pre><code>cmd /c "cmd /c for /F "usebackq tokens=2" %a in ("$(FULL_CURRENT_PATH)") do @echo %a" | clip
</code></pre>
<p dir="auto">Normally, to get Win to recognize a file with a space, you just have to put the quotes around it: <code>"$(FULL_CURRENT_PATH)"</code>.  However, <code>FOR /F ...</code> syntax uses the <code>("string here")</code> notation to use the contents of the string, rather than the contents of the file.  Using the <code>usebackq</code>, the string-quote character is changed from <code>""</code> to <code>''</code>, so the double-quotes go back to their Windows-purpose of allowing spaced filenames.</p>
<p dir="auto">I figured this out from the <code>help for</code> on the cmd.exe command line, but it wasn’t very well explained.  I then checked where I should have in the first place, and saw that <a href="http://ss64.com" rel="nofollow ugc">ss64.com</a>’s handy <a href="https://ss64.com/nt/for_f.html" rel="nofollow ugc">reference</a> explicitly says in the <strong>usebackq</strong> section, “This option is useful when dealing with a <em>filename</em> that is a long filename containing spaces, it allows you to put double quotes around the filename”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29357</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29357</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 11 Jan 2018 14:47:46 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Thu, 11 Jan 2018 14:19:48 GMT]]></title><description><![CDATA[<p dir="auto">Of course, all of that “breaks” if the pathname of the file it is run upon contains one or more space characters.  I’m not going to try to fix it.</p>
<p dir="auto">I was once a skilled batch file expert (even had a few things published a LONG time ago in magazines–remember those?), but I’ve long since lost interest due to the huge number of rules and special cases that no one can rightly remember.</p>
<p dir="auto">If someone else wants to tackle fixing it, I gratefully pass the gauntlet… :-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29356</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29356</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Thu, 11 Jan 2018 14:19:48 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Thu, 11 Jan 2018 14:01:33 GMT]]></title><description><![CDATA[<p dir="auto">If anyone tries <strong>Gogo</strong>’s solution, take care when using copy and paste on the provided <code>cmd /c ...</code> line.  This initially threw me as I would get this error:</p>
<p dir="auto"><img src="https://i.imgur.com/QD9Rjdf.png" alt="Imgur" class=" img-fluid img-markdown" /></p>
<p dir="auto">Removing the copied double-quotes and retyping them solved the problem–just an FYI.</p>
<p dir="auto">Also, changing the command line to this may be more useful than a hardcoded path:</p>
<p dir="auto"><code>cmd /c for /f "tokens=2" %a in ($(FULL_CURRENT_PATH)) do @echo %a</code></p>
<p dir="auto">For those that don’t have the <strong>NppExec</strong> plugin, this works just as well from the <strong>Run</strong> menu’s -&gt; <strong>Run…</strong> -&gt; <strong>The Program to Run</strong> box, leaving the results in the clipboard for easy pasting:</p>
<p dir="auto"><code>cmd /c "cmd /c for /f "tokens=2" %a in ($(FULL_CURRENT_PATH)) do @echo %a" | clip</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/29355</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29355</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Thu, 11 Jan 2018 14:01:33 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Thu, 11 Jan 2018 05:54:38 GMT]]></title><description><![CDATA[<p dir="auto">Using the NppExec plugin to<br />
display only the second column from a data file:<br />
cmd /c for /f “tokens=2” %a in (L:\SomeDataFile.txt) do @echo %a</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29346</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29346</guid><dc:creator><![CDATA[Gogo Neatza]]></dc:creator><pubDate>Thu, 11 Jan 2018 05:54:38 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Wed, 10 Jan 2018 21:00:04 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/wynford-junior-thomas" aria-label="Profile: wynford-junior-thomas">@<bdi>wynford-junior-thomas</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">Although the <strong>gawk</strong> software seems the <strong>right</strong> program for <strong>basic</strong> operations, like your, you may, of course, use the N++ <strong>search/replace</strong> feature, with the special <strong>regular expresion</strong> mode. Just follow these simple steps :</p>
<ul>
<li>
<p dir="auto">Open your file in Notepad++</p>
</li>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong><code>Ctrl + H</code></strong> )</p>
</li>
<li>
<p dir="auto">Check the <strong>two</strong> options <strong><code>Wrap around</code></strong> and <strong><code>Regular expresion</code></strong></p>
</li>
<li>
<p dir="auto">Type in the regex <strong><code>(?-s)^.+?\x20([0-9.]+).+</code></strong> , in the <strong>Find what:</strong> zone</p>
</li>
<li>
<p dir="auto">Type in the regex <strong><code>\1</code></strong> , in the <strong>Replace with:</strong> zone</p>
</li>
<li>
<p dir="auto">Click on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
<p dir="auto">Et voilà !</p>
<hr />
<p dir="auto">So, from an <strong>initial</strong> example, as below :</p>
<pre><code class="language-diff">example-svr 10.10.1.0 2018-01-01 12:44:42.350
my_server 10.255.255.57 2018-01-01 12:44:42.350
Super_server 201.150.1.0 2018-01-01 12:44:42.350
SVR_007 190.168.1.12 2018-01-01 12:44:42.350
</code></pre>
<p dir="auto">You’ll get the <strong>modified</strong> text, below :</p>
<pre><code class="language-diff">10.10.1.0
10.255.255.57
201.150.1.0
190.168.1.12
</code></pre>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">The <strong><code>(?-s)</code></strong> part means that the <strong>dot</strong>, <strong><code>.</code></strong> represents a single <strong>standard</strong> character, not an <strong>End of Line</strong> character</p>
</li>
<li>
<p dir="auto">The <strong><code>^</code></strong> represents the <strong>beginning</strong> of line location</p>
</li>
<li>
<p dir="auto">Then the part <strong><code>.+?</code></strong> is the <strong>smallest</strong> range of <strong>standard</strong> characters, before a <strong>space</strong> character <strong><code>x20</code></strong></p>
</li>
<li>
<p dir="auto">Now, the <strong><code>([0-9.]+)</code></strong> part represents an <strong>IP4</strong> address ( any <strong>digit</strong> or the <strong>dot</strong>, repeated <strong>one or more</strong> times. As it is surounded by <strong>parentheses</strong>, this IP address is stored as <strong>group 1</strong></p>
</li>
<li>
<p dir="auto">Finally, the <strong><code>.+</code></strong> part stands for the <strong>remaining</strong> of the <strong>current</strong> line</p>
</li>
<li>
<p dir="auto">In replacement, <strong>any</strong> line is changed by the <strong>IPV4</strong> address, only ( <strong><code>\2</code></strong> )</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29339</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29339</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 10 Jan 2018 21:00:04 GMT</pubDate></item><item><title><![CDATA[Reply to Removing Unwanted Columns on Wed, 10 Jan 2018 17:06:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/wynford-junior-thomas" aria-label="Profile: Wynford-Junior-Thomas">@<bdi>Wynford-Junior-Thomas</bdi></a></p>
<p dir="auto">I would not use an editor. I would use a scripting language instead. Here is one example of how simple the task is using GNU’s version of AWK :</p>
<pre><code>gawk "{print $2}" somefilename &gt; resultingfilename
</code></pre>
<p dir="auto">You can do it in the editor by performing a search and replace using regular expressions, but I’m not proficient enough with them to provide a good example for you.  I’m sure someone will in short order, though…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29326</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29326</guid><dc:creator><![CDATA[Jim Dailey]]></dc:creator><pubDate>Wed, 10 Jan 2018 17:06:38 GMT</pubDate></item></channel></rss>