- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: AWK difficulties
Operating System - HP-UX
1756017
Members
3673
Online
108839
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
09-29-2010 01:58 PM
09-29-2010 01:58 PM
Re: AWK difficulties
Hi (again):
> So, I thought by using the awk command to extract only the fields that I wanted would be better than the cut command
If all you are doing is comparing a string of fields, either 'awk' or 'cut' will work as we have described. AWK becomes very powerful when you want to match *and* extract (among other things).
As we say in the Perl community, TMTOWTDI :-)
As for points, thanks. Remember, every response is available for your evaluation and there is no limit to how many total points you can assign in any one thread.
http://forums11.itrc.hp.com/service/forums/helptips.do?#34
Regards!
...JRF...
> So, I thought by using the awk command to extract only the fields that I wanted would be better than the cut command
If all you are doing is comparing a string of fields, either 'awk' or 'cut' will work as we have described. AWK becomes very powerful when you want to match *and* extract (among other things).
As we say in the Perl community, TMTOWTDI :-)
As for points, thanks. Remember, every response is available for your evaluation and there is no limit to how many total points you can assign in any one thread.
http://forums11.itrc.hp.com/service/forums/helptips.do?#34
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2010 10:42 PM
09-29-2010 10:42 PM
Re: AWK difficulties
>I thought by using the awk command to extract only the fields that I wanted would be better than the cut command
Yes, awk(1) is much better than the cut(1) command in extracting fields, especially if you have a variable number of spaces/tabs between fields because of this:
Adjacent field delimiters delimit null fields.
>Hein: But be careful that field 9 is indeed unique. I typically 'help' that by adding separators (spaces) around the target string.
That won't help if you have duplicate fields. You may have to scan each field to see if it matches, then use index() that many times.
Yes, awk(1) is much better than the cut(1) command in extracting fields, especially if you have a variable number of spaces/tabs between fields because of this:
Adjacent field delimiters delimit null fields.
>Hein: But be careful that field 9 is indeed unique. I typically 'help' that by adding separators (spaces) around the target string.
That won't help if you have duplicate fields. You may have to scan each field to see if it matches, then use index() that many times.
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP