- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: awk statement
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
03-07-2007 11:48 PM
03-07-2007 11:48 PM
awk statement
cat $filename | grep $UNO| awk -v reg=$region -v cir=$circle -v uno=$UNO '$18 > 90 && $3==uno {print reg"\t"cir" \t "$3" \t " $4"-"$5"-"$6" \t "$18 "\t"}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 12:19 AM
03-08-2007 12:19 AM
Re: awk statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 09:28 AM
03-08-2007 09:28 AM
Re: awk statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 05:00 PM
03-08-2007 05:00 PM
Re: awk statement
Thanks Stuart for the generous reply, I will definitely check out and learn.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2007 10:08 AM
03-10-2007 10:08 AM
Re: awk statement
Sandeep,
Please re-read your own question carefully and now judge how anyone can possibly answer it?!
How can anyone know what 'desired' output is without specifying some details on both input and output format.
The suggested command might do something useful is the file pointed to by $filename is a file with white-space seperated columns where some lines contain $UNO in some 3rd columns. Some of those lines would need to have 18 or more columns and the value in column 18 should be larger than 90 for more that 1 of those.
But here is some free advide anyway!
Get rid of the 'cat' and the 'grep'!
Just let awk do the work!
awk -v... '$3==uno $18>90 {...}' $filename
Finally... have you simply tried it?
Just make a mock-up file with some valid lines and some bad lines.
Kindest regards,
Hein van den Heuvel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2007 03:01 PM
03-10-2007 03:01 PM
Re: awk statement
The easiest way to do that in awk is to set the Output Field Seperator (OFS) to tab.
awk -v... 'BEGIN {OFS="\t"} $3==uno... {print reg,cir,$3,...}'
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2007 09:29 PM
03-11-2007 09:29 PM
Re: awk statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2007 09:31 PM
03-11-2007 09:31 PM