- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: awk - print range of fields
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
Discussions
Discussions
Forums
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
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
тАО06-28-2007 05:47 AM
тАО06-28-2007 05:47 AM
Re: awk - print range of fields
Sometimes I'd like to try Perl but We don't use it except in some OS scripts and noboby in my shop is proficient.
It would become a maintenance problem.
Is there a -quick- way to learn Perl?
Which manual would you recommend?
Rayb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2007 06:03 AM
тАО06-28-2007 06:03 AM
Re: awk - print range of fields
I'd probably start with "Learning Perl" from the O'Reilly publishers. A compendium of links to good stuff is:
http://perlmonks.org/index.pl?node_id=284175
Like any language, the best way to really learn it is to use it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2007 06:59 AM
тАО06-28-2007 06:59 AM
Re: awk - print range of fields
Perhaps the worst quality of Perl is also its best quality: the ability to pack an enormous amount of processing into one line. This characteristic makes it very easy to produce Perl code that is extremely cryptic especially for beginners. It's really quite easy to write Perl in a style that is verbose and clear; it's just not done that often. I suppose that it's one of those "suffering (or at least confusion) is good for the soul" things.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2007 07:23 AM
тАО06-28-2007 07:23 AM
Re: awk - print range of fields
Btw... if the contents of field $6 van not match fields $1 - $5, then a simple awk solution could be:
$ awk '{print $4,$2,$3,substr($0,index($0,$6))}' x.tmp
If $6 is a 'short' field then you can increase its uniqueness by pre end-or post pending a knwo separator:
$ awk '{print $4,$2,$3,substr($0,index($0," " $6 " "))}' x.tmp
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2007 09:04 AM
тАО06-28-2007 09:04 AM
Re: awk - print range of fields
cut -f 4,2,3,6- inputfile >outputfile
cut assumes tab for the delimiter, but you can override with the -d option.
HTH
Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2007 03:36 PM
тАО06-28-2007 03:36 PM
Re: awk - print range of fields
cut(1) is usually not a better tool than awk.
It has rigorous ideas of delimiters, if you have more than one between fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2007 12:44 AM
тАО06-29-2007 12:44 AM
Re: awk - print range of fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2007 12:48 AM
тАО06-29-2007 12:48 AM
Re: awk - print range of fields
- « Previous
-
- 1
- 2
- Next »