Reference: > From: "SigmaX asdf" <[EMAIL PROTECTED]> > Date: Tue, 19 Sep 2006 12:26:54 -0400 > Message-id: <[EMAIL PROTECTED]>
"SigmaX asdf" wrote: > Yo; > > I have a series of comma-delimited text files with fourteen columns of > data and several hundred 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? awk ! /usr/ports/lang/gawk exists too. PS Here's odd notes from my syntax file, not exactly appropriate to you, but near enough to give ideas with `man awk' for ref, & `fun' to learn ;-) ---- awk '{printf "rm -f %s ; ln -s ..%s %s\n",$1,$3,$1}' < /tmp/x awk -F = '{printf "%s\n",$1}' < /tmp/t awk --field-separator # '{printf "%s\n",$1}' awk -F # '{printf "%s\n",$1}' # 5.0 has no --field-separator awk '{printf "%s\n",$1}' < distfiles.dump find /etc /var /usr -type l | sort | xargs ls -l | \ awk '{printf "%s -> %s\n",$9,$11}' # List all links -- Julian Stacey. BSD Unix C Net Consultancy, Munich/Muenchen http://berklix.com Mail Ascii, not HTML. Ihr Rauch = mein allergischer Kopfschmerz. Don't buy it ! Get it free ! http://berklix.org/free-software _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "[EMAIL PROTECTED]"