Got it. Thanx for the pointer.<br><br>$ cut -f 1-5 -d , -s input.txt > output.txt<br><br>Nice one liner! 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> <<a href="mailto:max.luebbe@gmail.com">max.luebbe@gmail.com</a>> 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>> I don't have the answer to that but I'd like to know it also....<br>> even the C++ solution<br>><br>> mike<br>><br>><br>> On 9/19/06, Eric O'Neal <<a href="mailto:fyedernoggersnodden@gmail.com">
fyedernoggersnodden@gmail.com</a>> wrote:<br>> Yo;<br>><br>> I have a series of comma-delimited text files with fourteen<br>> columns of data and several rows. I want to use a short shell
<br>> script to strip them of the last 9 columns, leaving the same<br>> file but with just five of its columns. I can do it in C++,<br>> but that seems like overkill. How would I go about doing it
<br>> with sed or a similar utility?<br>><br>> SigmaX<br>><br>><br>> --<br>> My home page: <a href="http://www.SigmaX.org">http://www.SigmaX.org</a><br>><br>> "ttocs laeno cire oshkosh b'gosh fyedernoggersnodden nicht
<br>> stein bon probiscus"<br>><br>> "Education is what remains after one has forgotten everything<br>> he learned in school"<br>> -- Albert Einstein
<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>><br>><br>><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: <a href="http://www.SigmaX.org">
http://www.SigmaX.org</a><br><br>"ttocs laeno cire oshkosh b'gosh fyedernoggersnodden nicht stein bon probiscus"<br><br>"Education is what remains after one has forgotten everything he learned in school"
<br> -- Albert Einstein