Grep output to columns

I know how to extract a field to a log file using:
% grep something filename | awk '{print $3}' > output.log

filename:
06/07, something TEST1 TEST2 blah blah TEST4

Is there a way to output 2 or more fields to a file in columns.

Output.log with $3 $4 $7:

TEST1 TEST2 TEST4
.
.
.
Thanx



RudePuppyDogAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
joolsConnect With a Mentor Commented:
Do you mean;

grep something filename | awk '{print $3" "$4" "$7}' > output.log

or formatted output for variable length fields?
0
 
RudePuppyDogAuthor Commented:
That is exactly what I meant ... cant believe it was that easy.  Brain Freeze.  Thanx
0
 
joolsCommented:
Cool, I can't believe it was that easy either!! :-)
0
All Courses

From novice to tech pro — start learning today.