- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Grep/Awk functionalty request
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
11-03-2000 03:51 AM
11-03-2000 03:51 AM
I am looking for your assistance once again.
This time I need to extract from a file the last field regardless of whether it is the fourth, fifth or sixth fields, for example
1679 <****** DWDW COPY VWC87.
1788 CR362 * HGHT HTYG COPY VW4B0.
1793 <** JHGF DERE HGFDE GGG COPY VW4C8.
in this example I would need VWC87., VW4B0. and VW4C8. returned.
Can anybody help please.
Thanking you.
Dave
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 03:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 04:01 AM
11-03-2000 04:01 AM
Re: Grep/Awk functionalty request
simply use:
awk '{print $NF}' file
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 04:03 AM
11-03-2000 04:03 AM
Re: Grep/Awk functionalty request
simply use:
awk '{print $NF}' file
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 04:09 AM
11-03-2000 04:09 AM
Re: Grep/Awk functionalty request
Hpe this helps.
Regards
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 04:27 AM
11-03-2000 04:27 AM
Re: Grep/Awk functionalty request
cat your_file | awk '{print $NF}'
federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:31 AM
11-03-2000 05:31 AM
Re: Grep/Awk functionalty request
you can do integer arithmetic with the awk qualifiers like NR, NF.
Sometimes some output produces inconsistent (or rather unpredictable) numbers of fields, but you know that the wanted field is always say n-2
awk '{print $(NF-2)}' /your/file/to/parse