Got it.&nbsp; Thanx for the pointer.<br><br>$ cut -f 1-5 -d , -s input.txt &gt; output.txt<br><br>Nice one liner!&nbsp; Beats my relatively gargantuan pair of for loops in C++ ;-) (One to read and one to write).<br><br>SigmaX<br><br>
<div><span class="gmail_quote">On 9/19/06, <b class="gmail_sendername">Max Luebbe</b> &lt;<a href="mailto:max.luebbe@gmail.com">max.luebbe@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'll bust out the ol' UNIX book after I get back from the sox game<br>tonight.<br><br>Meanwhile, check out the man page for cut.<br>Using that in a bash script could do this pretty easy.<br><br>-Max<br><br>On Tue, 2006-09-19 at 12:11 -0500, Mike Greenwood wrote:
<br>&gt; I don't have the answer to that but I'd like to know it also....<br>&gt; even the C++ solution<br>&gt;<br>&gt; mike<br>&gt;<br>&gt;<br>&gt; On 9/19/06, Eric O'Neal &lt;<a href="mailto:fyedernoggersnodden@gmail.com">
fyedernoggersnodden@gmail.com</a>&gt; wrote:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yo;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I have a series of comma-delimited text files with fourteen<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; columns of data and several rows.&nbsp;&nbsp;I want to use a short shell
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; script to strip them of the last 9 columns, leaving the same<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file but with just five of its columns.&nbsp;&nbsp;I can do it in C++,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; but that seems like overkill.&nbsp;&nbsp;How would I go about doing it
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with sed or a similar utility?<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SigmaX<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; My home page:&nbsp;&nbsp;<a href="http://www.SigmaX.org">http://www.SigmaX.org</a><br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;ttocs laeno cire oshkosh b'gosh fyedernoggersnodden nicht
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stein bon probiscus&quot;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Education is what remains after one has forgotten everything<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; he learned in school&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Albert Einstein
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ubuntu-us-chicago mailing list<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:Ubuntu-us-chicago@lists.ubuntu.com">Ubuntu-us-chicago@lists.ubuntu.com</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-chicago">
https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-chicago</a><br>&gt;<br>&gt;<br>&gt;<br><br><br>--<br>Ubuntu-us-chicago mailing list<br><a href="mailto:Ubuntu-us-chicago@lists.ubuntu.com">Ubuntu-us-chicago@lists.ubuntu.com
</a><br><a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-chicago">https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-chicago</a><br></blockquote></div><br><br clear="all"><br>-- <br>My home page:&nbsp;&nbsp;<a href="http://www.SigmaX.org">
http://www.SigmaX.org</a><br><br>&quot;ttocs laeno cire oshkosh b'gosh fyedernoggersnodden nicht stein bon probiscus&quot;<br><br>&quot;Education is what remains after one has forgotten everything he learned in school&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-- Albert Einstein