Ubuntu-Chicago OT: sed and tab-delimited file

Eric O'Neal fyedernoggersnodden at gmail.com
Wed Sep 20 01:48:03 BST 2006


Got it.  Thanx for the pointer.

$ cut -f 1-5 -d , -s input.txt > output.txt

Nice one liner!  Beats my relatively gargantuan pair of for loops in C++ ;-)
(One to read and one to write).

SigmaX

On 9/19/06, Max Luebbe <max.luebbe at gmail.com> wrote:
>
> I'll bust out the ol' UNIX book after I get back from the sox game
> tonight.
>
> Meanwhile, check out the man page for cut.
> Using that in a bash script could do this pretty easy.
>
> -Max
>
> On Tue, 2006-09-19 at 12:11 -0500, Mike Greenwood wrote:
> > I don't have the answer to that but I'd like to know it also....
> > even the C++ solution
> >
> > mike
> >
> >
> > On 9/19/06, Eric O'Neal <fyedernoggersnodden at gmail.com> wrote:
> >         Yo;
> >
> >         I have a series of comma-delimited text files with fourteen
> >         columns of data and several rows.  I want to use a short shell
> >         script to strip them of the last 9 columns, leaving the same
> >         file but with just five of its columns.  I can do it in C++,
> >         but that seems like overkill.  How would I go about doing it
> >         with sed or a similar utility?
> >
> >         SigmaX
> >
> >
> >         --
> >         My home page:  http://www.SigmaX.org
> >
> >         "ttocs laeno cire oshkosh b'gosh fyedernoggersnodden nicht
> >         stein bon probiscus"
> >
> >         "Education is what remains after one has forgotten everything
> >         he learned in school"
> >                       -- Albert Einstein
> >
> >         --
> >         Ubuntu-us-chicago mailing list
> >         Ubuntu-us-chicago at lists.ubuntu.com
> >         https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-chicago
> >
> >
> >
>
>
> --
> Ubuntu-us-chicago mailing list
> Ubuntu-us-chicago at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-chicago
>



-- 
My home page:  http://www.SigmaX.org

"ttocs laeno cire oshkosh b'gosh fyedernoggersnodden nicht stein bon
probiscus"

"Education is what remains after one has forgotten everything he learned in
school"
              -- Albert Einstein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-us-chicago/attachments/20060919/f18d2ca3/attachment.htm 


More information about the Ubuntu-us-chicago mailing list