MLUG: Re: [MLUG - DISCUSSION] dumb questions for the day
Re: [MLUG - DISCUSSION] dumb questions for the day
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Wed, 7 Jun 2006, Rick wrote:

I guess I've been saving up my dumb questions the last couple of days...

What's the syntax for grabbing everything to the end of the line in awk? I've dug thru my sed&awk book but can't seem to find it even though I'm sure I've seen it in there before.

The entire line is $0 as in...

awk '$4>6 {print $0}' infile > outfile

That stores every line where the fourth field exceeds 6.

The annoying limitation in awk is that you can't give a range of fields like "$5-$12" or whatever. You can use 'cut' for that, but it parses the line a little differently unless you use perl or somesuch to preprocess the line. I know there is an awk mode in perl that probably deals with this problem well, but I haven't used it. Jon King and Stephen M-S seem to be the local experts on that.

Mike

_______________________________________________
discussion mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/discussion