Solved

Grep output to columns

Posted on 2002-07-26
3
704 Views
Last Modified: 2013-12-26
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



0
Comment
Question by:RudePuppyDog
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
jools earned 50 total points
ID: 7180641
Do you mean;

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

or formatted output for variable length fields?
0
 

Author Comment

by:RudePuppyDog
ID: 7180824
That is exactly what I meant ... cant believe it was that easy.  Brain Freeze.  Thanx
0
 
LVL 19

Expert Comment

by:jools
ID: 7181692
Cool, I can't believe it was that easy either!! :-)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 115
viewing source code from eclipse 13 104
bigDiff challenge 17 105
EvenOdd challenge 10 107
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question