- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: get certain fields within an output
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 10:09 PM
04-23-2007 10:09 PM
more awk help needed please:
I want to print some information in awk:
info1 info2 info3 info4
info5 info6 info7 info8
info9 info10 info11 info12
info13 info14 info15 info16
this is an example output ...
how do I use awk to print info4, info8 and info 12 please, the only common denominator in the sting is PP however this string will appear in info5 and info9 for example.
hope this makes sense!
Thanks in advance.
Chris
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 10:21 PM
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 10:41 PM
04-23-2007 10:41 PM
Re: get certain fields within an output
as easy as that ....
I knew this but wasnt thinking ...
Thanks for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 10:43 PM
04-23-2007 10:43 PM
Re: get certain fields within an output
In awk $"column number" displays the whole column values.
lets say for example you wnat to print 4th cloumn you may use
awk '{print $4}'. I assume from your query that you wanted to print the whole 4th column, though you had missed info16
rgds
perumal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 10:44 PM
04-23-2007 10:44 PM
Re: get certain fields within an output
Use following if ur i/p to awk is
info1 info2 info3 info4
info5 info6 info7 info8
info9 info10 info11 info12
info13 info14 info15 info16
--------------------------
# awk '{print $4}'
--------------------------
but I don't understand what do u mean by this
--------------------------
how do I use awk to print info4, info8 and info 12 please, the only common denominator in the sting is PP however this string will appear in info5 and info9 for example.
---------------------------
Pl. elaborate above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 10:46 PM
04-23-2007 10:46 PM
Re: get certain fields within an output
I wasnt thinking straight:
my solution is
awk '/PPs:/ {print $4,$5": "$6}' datafile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 10:47 PM
04-23-2007 10:47 PM