Effective awk Programming (3rd Edition)

  Author:    Arnold Robbins
  ISBN:    0596000707
  Sales Rank:    271205
  Published:    2001-05-15
  Publisher:    O'Reilly Media, Inc.
  # Pages:    456
  Binding:    Paperback
  Avg. Rating:    5.0 based on 5 reviews
  Used Offers:    8 from $20.54
  Amazon Price:    $29.16
  (Data above last updated:  2008-11-18 08:40:55 EST)
  
  
Sort customer reviews by:
  
Show All Reviews on Page      Hide All Reviews on Page
   
  
Effective awk Programming (3rd Edition)
  
Effective awk Programming,3rd Edition, focuses entirely on awk, exploring it in the greatest depth of the three awk titles we carry. It's an excellent companion piece to the more broadly focused second edition. This book provides complete coverage of the gawk 3.1 language as well as the most up-to-date coverage of the POSIX standard for awk available anywhere. Author Arnold Robbins clearly distinguishes standard awk features from GNU awk (gawk)-specific features, shines light into many of the "dark corners" of the language (areas to watch out for when programming), and devotes two full chapters to example programs. A brand new chapter is devoted to TCP/IP networking with gawk. He includes a summary of how the awk language evolved. The book also covers:
  • Internationalization of gawk
  • Interfacing to i18n at the awk level
  • Two-way pipes
  • TCP/IP networking via the two-way pipe interface
  • The new PROCINFO array, which provides information about running gawk
  • Profiling and pretty-printing awk programs
In addition to covering the awk language, this book serves as the official "User's Guide" for the GNU implementation of awk (gawk), describing in an integrated fashion the extensions available to the System V Release 4 version of awk that are also available in gawk. As the official gawk User's Guide, this book will also be available electronically, and can be freely copied and distributed under the terms of the Free Software Foundation's Free Documentation License (FDL). A portion of the proceeds from sales of this book will go to the Free Software Foundation to support further development of free and open source software. The third edition of Effective awk Programming is a GNU Manual and is published by O'Reilly & Associates under the Free Software Foundation's Free Documentation License (FDL). A portion of the proceeds from the sale of this book is donated to the Free Software Foundation to further development of GNU software. This book is also available in electronic form; you have the freedom to modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.
For anyone who writes scripts in the awk family of languages, the third edition of Effective awk Programming provides an in-depth guide to processing text files with plenty of working sample code. Whether you are starting out with awk or are an experienced developer, this book will help you extend the reach of your awk scripts.

This tutorial covers the entire spectrum of awk script development: From the basics of opening, searching, and transforming text files, to a comprehensive tutorial for regular expressions, to more advanced features like internetworking. The focus is on the practical side of creating and running awk scripts, and there's plenty of hands-on advice for installing and running today's awk (and gawk).

The book begins with the fundamentals of awk for opening and transforming text flat files. The coverage of regular expressions, from simple rules for matching text to more advanced options, is particularly solid. You learn how to add variables and expressions for more intelligent awk scripts, plus how to parse data into records and fields. You'll also find out how to redirect output from awk scripts to other programs, a useful technique that can cause awk to get a lot more done in real applications.

Later, you learn several valuable sample awk scripts that mimic existing Unix utilities (like grep, id, and split), plus samples for counting words in documents and printing mailing labels, and even a stream editor. This grab bag of sample code lets you try out the techniques presented earlier in the book. Other sections look at support for networking in today's gawk; for example, how gawk can read and write to URLs on the network almost just as easily as local files. Full sample code will teach the beginner or expert how to get productive with networks and awk. Final appendices trace the evolution of the awk language and show you how to download and install gawk.

Suitable for beginner and experienced awk developers, Effective awk Programming, Third Edition, is an extremely worthwhile source of information on a wide range of programming techniques for today's awk. --Richard Dragan

Topics covered:

  • Introduction to the awk programming language
  • Running awk scripts
  • Basic file processing
  • Tutorial for regular expressions
  • Strategies for matching text
  • Dynamic regular expressions
  • Parsing data into records and lines (including separating fields and handling multiple-line records)
  • Using print and printf for printed output with awk (including format specifiers)
  • Redirecting awk scripts output to other processes
  • Basic and advanced awk expressions (constants, variables, and function calls)
  • Patterns
  • Shell variables and actions
  • Arrays (including multidimensional arrays and sorting)
  • Built-in and custom awk functions
  • Internationalizing and localizing awk scripts
  • Advanced gawk (communicating with other processes and networking programming)
  • Running awk and gawk
  • Sample awk scripts
  • Internetworking with awk
  • History and evolution of awk
  • Downloading and installing gawk
                  Reader Reviews 1 - 7 of 7                 
  
  
Review
Date
Review
Rating(5 High)
Review
Helpful
to:
Customer Review Reviewer
Info
Permanent
Link
Reader Reviews Below Sorted by Newest First
11-28-07 4 (NA)
(Hide Review...)  Old Reliable AWK
Reviewer Permalink
Every once in a while I am told to panic and get something done in an unreasonable amount of time. When the "something" involves text processing I sometimes return to AWK, and last night it saved my bacon once again. This book has never quite given me the sort of reader experience I'd hoped for, but it does get the job done and can help you do the same.
(Review Data Last Updated: 2008-11-19 05:49:26 EST)
01-17-07 5 3\3
(Hide Review...)  Excellent tutorial & reference that zeroes in on awk
Reviewer Permalink
This book explains both the awk language and how to run the awk utility. You should already be familiar with basic system commands, such as cat and ls, as well as basic shell facilities, such as input/output redirection and pipes. This book describes the awk language in general and also the particular implementation of awk called gawk. gawk runs on a broad range of Unix systems and has also been ported to Mac OS X, MS-DOS, Microsoft Windows, and VMS.

Many people are familiar with O'Reilly's book on sed and awk, but not this book. If you want to zero in on awk and its capabilities, this is really the better of the two books. It makes an excellent tutorial and reference for system administrators and anyone else that wants to use awk to extract and format text. The following is a description of the book from the context of the table of contents:

Chapter 1. The awk language and gawk - talks about the basics including how to run awk, when you should use awk, and starts you off with a few simple examples.

Chapter 2. Regular expressions - introduces regular expressions in general, and in particular the flavors supported by POSIX awk and gawk.

Chapter 3 Reading Input Files - describes how awk reads your data. It introduces the concepts of records and fields, as well as the getline command. I/O redirection is first described here.

Chapter 4. Printing Output - Besides basic and formatted printing, this chapter also covers I/O redirections to files and pipes, introduces the special filenames that gawk processes internally, and discusses the close built-in function.

Chapter 5. Expressions - describes expressions, which are the basic building blocks of awk patterns and actions.

Chapter 6. Patterns, Actions, and Variables - Each awk statement consists of a pattern with an associated action. This chapter describes how you build patterns and actions, what kinds of things you can do within actions, and awk's built-in variables.

Chapter 7. Arrays in awk - describes how arrays work in awk, how to use array elements, how to scan through every element in an array, and how to remove array elements. It also describes how awk simulates multidimensional arrays, as well as some of the less obvious points about array usage. The chapter finishes with a discussion of gawk's facility for sorting an array based on its indices.

Chapter 8. Functions - describes awk's built-in functions, which fall into three categories: numeric, string, and I/O. gawk provides additional groups of functions to work with values that represent time, do bit manipulation, and internationalize and localize programs.

Chapter 9. Internationalization with gawk - describes the underlying library gawk uses for internationalization, as well as how gawk makes internationalization features available at the awk program level. Having internationalization available at the awk level gives software developers additional flexibility - they are no longer required to write in C when internationalization is a requirement.

Chapter 10. Advanced Features of gawk - a "grab bag" of items that are otherwise unrelated to each other. First, a command-line option allows gawk to recognize nondecimal numbers in input data, not just in awk programs. Next, two-way I/O, discussed briefly in earlier parts of this book, is described in full detail, along with the basics of TCP/IP networking and BSD portal files. Finally, gawk can profile an awk program, making it possible to tune it for performance.

Chapter 11. Running awk and gawk - covers how to run awk, both POSIX-standard and gawk-specific command-line options, and what awk and gawk do with non-option arguments. It then proceeds to cover how gawk searches for source files, obsolete options and/or features, and known bugs in gawk. This chapter rounds out the discussion of awk as a program and as a language. While a number of the options and features described here were discussed in passing earlier in the book, this chapter provides the full details.

Chapter 12. A Library of awk Functions - One valuable way to learn a new programming language is to read programs in that language. To that end, this chapter and Chapter 13 provide a good-sized body of code for you to read, and hopefully, to learn from.

Chapter 13. Practical awk Programs - presents a potpourri of awk programs for your reading enjoyment. The first part describes how to run the programs presented in this chapter. The second presents awk versions of several common POSIX utilities. These are programs that you are hopefully already familiar with, and therefore, whose problems are understood. By reimplementing these programs in awk, you can focus on the awk-related aspects of solving the programming problem.

Chapter 14. Internetworking with gawk - describes gawk's networking features in depth, including a number of interesting examples and the reusable core of a gawk-based web server. The chapter is adapted from "TCP/IP Internetworking with gawk", by Jürgen Kahrs and Arnold Robbins, which is a separate document distributed with gawk.

Thus chapters 1-11 form a tutorial and reference on awk itself, and the last three chapters are additional material for reference or your own personal toolchest of programs. The last chapter is more of a curiosity than anything, since I don't know anyone who does internetworking with gawk, but it is still interesting material. I highly recommend this book if you plan to use awk extensively.
(Review Data Last Updated: 2007-11-28 13:12:51 EST)
01-17-07 5 1\1
(Hide Review...)  Excellent tutorial & reference that zeroes in on awk
Reviewer Permalink
This book explains both the awk language and how to run the awk utility. You should already be familiar with basic system commands, such as cat and ls, as well as basic shell facilities, such as input/output redirection and pipes. This book describes the awk language in general and also the particular implementation of awk called gawk. gawk runs on a broad range of Unix systems and has also been ported to Mac OS X, MS-DOS, Microsoft Windows, and VMS.

Many people are familiar with O'Reilly's book on sed and awk, but not this book. If you want to zero in on awk and its capabilities, this is really the better of the two books. It makes an excellent tutorial and reference for system administrators and anyone else that wants to use awk to extract and format text. The following is a description of the book from the context of the table of contents:

Chapter 1. The awk language and gawk - provides the essentials you need to know to begin using awk.

Chapter 2. Regular expressions - introduces regular expressions in general, and in particular the flavors supported by POSIX awk and gawk.

Chapter 3 Reading Input Files - describes how awk reads your data. It introduces the concepts of records and fields, as well as the getline command. I/O redirection is first described here.

Chapter 4. Printing Output - Besides basic and formatted printing, this chapter also covers I/O redirections to files and pipes, introduces the special filenames that gawk processes internally, and discusses the close built-in function.

Chapter 5. Expressions - describes expressions, which are the basic building blocks of awk patterns and actions.

Chapter 6. Patterns, Actions, and Variables - Each awk statement consists of a pattern with an associated action. This chapter describes how you build patterns and actions, what kinds of things you can do within actions, and awk's built-in variables.

Chapter 7. Arrays in awk - describes how arrays work in awk, how to use array elements, how to scan through every element in an array, and how to remove array elements. It also describes how awk simulates multidimensional arrays, as well as some of the less obvious points about array usage. The chapter finishes with a discussion of gawk's facility for sorting an array based on its indices.

Chapter 8. Functions - describes awk's built-in functions, which fall into three categories: numeric, string, and I/O. gawk provides additional groups of functions to work with values that represent time, do bit manipulation, and internationalize and localize programs.

Chapter 9. Internationalization with gawk - describes the underlying library gawk uses for internationalization, as well as how gawk makes internationalization features available at the awk program level. Having internationalization available at the awk level gives software developers additional flexibility - they are no longer required to write in C when internationalization is a requirement.

Chapter 10. Advanced Features of gawk - a "grab bag" of items that are otherwise unrelated to each other. First, a command-line option allows gawk to recognize nondecimal numbers in input data, not just in awk programs. Next, two-way I/O, discussed briefly in earlier parts of this book, is described in full detail, along with the basics of TCP/IP networking and BSD portal files. Finally, gawk can profile an awk program, making it possible to tune it for performance.

Chapter 11. Running awk and gawk - covers how to run awk, both POSIX-standard and gawk-specific command-line options, and what awk and gawk do with non-option arguments. It then proceeds to cover how gawk searches for source files, obsolete options and/or features, and known bugs in gawk. This chapter rounds out the discussion of awk as a program and as a language. While a number of the options and features described here were discussed in passing earlier in the book, this chapter provides the full details.

Chapter 12. A Library of awk Functions - One valuable way to learn a new programming language is to read programs in that language. To that end, this chapter and Chapter 13 provide a good-sized body of code for you to read, and hopefully, to learn from.

Chapter 13. Practical awk Programs - presents a potpourri of awk programs for your reading enjoyment. The first part describes how to run the programs presented in this chapter. The second presents awk versions of several common POSIX utilities. These are programs that you are hopefully already familiar with, and therefore, whose problems are understood. By reimplementing these programs in awk, you can focus on the awk-related aspects of solving the programming problem.

Chapter 14. Internetworking with gawk - describes gawk's networking features in depth, including a number of interesting examples and the reusable core of a gawk-based web server. The chapter is adapted from "TCP/IP Internetworking with gawk", by Jürgen Kahrs and Arnold Robbins, which is a separate document distributed with gawk.

Thus chapters 1-11 form a tutorial and reference on awk itself, and the last three chapters are additional material for reference or your own personal toolchest of programs. The last chapter is more of a curiosity than anything, since I don't know anyone who does internetworking with gawk, but it is still interesting material. I highly recommend this book if you plan to use awk extensively.
(Review Data Last Updated: 2007-03-03 17:58:20 EST)
01-05-07 4 1\1
(Hide Review...)  really good reference
Reviewer Permalink
really simple to understand, and quick to get started. could have a bit more on regexp, but can easily be paired with a dedicated text. the examples are clear, the explanations are concise, and the content is well organized and presented.
(Review Data Last Updated: 2007-02-06 15:11:49 EST)
02-22-06 4 2\3
(Hide Review...)  This book is an essential for people writing unix scripts and doing system administration
Reviewer Permalink
Awk is a powerful tool to perform search, and pattern matching on the strings/files.

This book is an essential for people writing unix scripts and doing system administration.

It gives you insight on how things work, and has very nice examples and tricks to perform the tasks.

Mostly the majority of the tasks are covered in the beginning, and the deep rooted tasks, are covered in the later chapters.
(Review Data Last Updated: 2007-02-06 15:11:49 EST)
02-01-02 5 24\25
(Hide Review...)  Most Complete Coverage of Awk
Reviewer Permalink
Awk is one of those handy Unix tools with which you can easily impress people. Using a simple

/pattern/ { action }

syntax, you can construct powerful one-liners. Do you want to how much time in total you spent surfing the Internet? Here it is:

awk '/Connect time/ { s += $8 } END { print s }' /var/log/messages

It doesn't get much shorter in any other programming language, does it? Need to strip text of HTML tags? Need a frequency count of words in a text? Awk is the perfect tool for tasks like this. With its pattern-action structure, powerful regular expression mechanism, associative arrays and basic program flow control, it provides a powerful tool for manipulating flat text files. Even though other scripting languages may be richer in features, there exists a niche where Awk is just the right tool to do the job.

Arnold Robbins, the author of this book as well as of several other books on Awk, serves also as the maintainer of GNU Awk (gawk for short), the most influential version of Awk available today. With the version 3.10, released in 2001, GNU Awk became richer for a handful of new extensions over traditional Awk, most important among them are the TCP/IP networking and the support for internationalization. All new extensions are described in the book. How successful these new extensions will be is doubtful, however. Networking scripting niche is already well covered with Perl and Python, and internationalization doesn't really matter much in short throw-away scripts Awk is usually used for.

With all due respect to the creators of Awk and their book (Alfred V. Aho, Peter J. Weinberger, Brian W. Kernighan, The Awk Programming Language, Addison-Wesley, 1988), I have to say that "Effective Awk Programming" is probably the best Awk tutorial on the market today. If you are serious about learning Awk, you shouldn't be without it. If you are still hesitating whether it wouldn't be wiser investing those 28 USD elsewhere, here is chance to read it before you buy it: install GNU Awk 3.10, and the Texinfo source of the book comes with it. But sooner or later you will find O'Reilly RepKover binding too tempting...

(Review Data Last Updated: 2006-06-06 12:58:29 EST)
05-18-01 4 7\8
(Hide Review...)  awk programming
Reviewer Permalink
This book is being picked up by the O'Reilly people. I have many of the O'Reilly books on my book shelf. There will be a third edition due out in July with Robbins as the author. I read though this book and thought it as good or better than the "Sed & awk" book that O'Reilly presently has out. Robbins is also an author on this book. I thought the book to be better than the "AWK programming language" by Aho, Kerninghan and Weinberger, the original authors of the AWK language. I recommend the book to beginers as I am.
(Review Data Last Updated: 2006-06-06 12:58:29 EST)
  
                  Reader Reviews 1 - 7 of 7                 
  
  
  
  
  
  

Because the data used to generate this site come from outside sources, VeryWellSaid.com cannot guarantee the completeness or accuracy of the data.
Search VeryWellSaid™
Google
Web VeryWellSaid™
New subjects are added every week.
View Subjects Below by:
* Top Selling
 (click category name, left)
* Top-Rated Top Sellers
 (click 'Top Rated', right)
In the news...  
Dubai\UAE Top Rated
Influenza\Bird Flu Top Rated
Iraq Top Rated
Supreme Court Top Rated
All Books Top Rated
Arts Top Rated
Photography Top Rated
Digital Photography Top Rated
Digital Cameras Top Rated
Biography Top Rated
Business Top Rated
Management Top Rated
Marketing Top Rated
Sales Top Rated
Stocks Top Rated
Bonds Top Rated
Real Estate Top Rated
Trading Top Rated
Commodities Trading Top Rated
Time Management Top Rated
Starting A Business Top Rated
Children's Top Rated
Comics Top Rated
Computers Top Rated
PC Top Rated
Mac Top Rated
Programming Top Rated
Design Patterns Top Rated
.Net Top Rated
C# Top Rated
Vb.Net Top Rated
Asp.Net Top Rated
Java Top Rated
Python Top Rated
PHP Top Rated
Perl Top Rated
Javascript Top Rated
Ajax Top Rated
CSS Top Rated
Open Source Top Rated
SQL Top Rated
Databases Top Rated
Oracle Top Rated
MySql Top Rated
Sql Server Top Rated
IIS Top Rated
Apache Top Rated
Linux Top Rated
Windows Server Top Rated
Project Management Top Rated
HTML Top Rated
UML Top Rated
IT Certifications Top Rated
Cisco Certifications Top Rated
MCSE Top Rated
MCSD Top Rated
Cooking Top Rated
Italian Cooking Top Rated
Vegetarian Cooking Top Rated
Wine Top Rated
Engineering Top Rated
Entertainment Top Rated
Health Top Rated
Nutrition Top Rated
Dieting Top Rated
Sex Top Rated
History Top Rated
Military History Top Rated
British History Top Rated
Middle East History Top Rated
Land Battles Top Rated
Naval Warfare Top Rated
Air Warfare Top Rated
9/11 Top Rated
Terrorism Top Rated
Home Top Rated
Mortgage\Home Equity Loan Top Rated
Cars Top Rated
Car Buying Top Rated
Sports Cars Top Rated
Cat Top Rated
Humor Top Rated
Horror Top Rated
Law Top Rated
IP Law Top Rated
Legal History Top Rated
Fiction Top Rated
Oprah's Book Club Top Rated
Medicine Top Rated
Cancer Top Rated
Stroke Top Rated
Heart Disease Top Rated
Fertility Top Rated
Diabetes Top Rated
Pharmacology Top Rated
Back Problems Top Rated
Menopause Top Rated
Thyroid Top Rated
Pain Top Rated
Organic Chemistry Top Rated
Immune System Top Rated
Mystery Top Rated
Nonfiction Top Rated
Outdoors Top Rated
Running Top Rated
Radio Control Models Top Rated
Guns Top Rated
Parenting Top Rated
Divorce Top Rated
Professional Top Rated
Reference Top Rated
Religion Top Rated
Romance Top Rated
Science Top Rated
Physics Top Rated
Chemistry Top Rated
Astronomy Top Rated
Psychology Top Rated
Science Fiction Top Rated
Sports Top Rated
Teens Top Rated
Travel Top Rated
USA Top Rated
Europe Top Rated
France Top Rated
Italy Top Rated
England Top Rated
China Top Rated
All Books Arts Biography Click Here For An A-Z Index Of All 213 Best-Seller Subjects Business Children's Comics
Computers Cooking Engineering Entertainment Health History Home Horror Humor Law Fiction Medicine Mystery
Nonfiction Outdoors Parenting Professional Reference Religion Romance Science Sci-Fi Sports Teens Travel
In Association with Amazon.com

Cache miss
(not cached)