Book description
This practical guide serves as both a reference and tutorial for POSIX-standard awk and for the GNU implementation, called gawk. This book is useful for novices and awk experts alike. In this thoroughly revised edition, author and gawk lead developer Arnold Robbins describes the awk language and gawk program in detail, shows you how to use awk and gawk for problem solving, and then dives into specific features of gawk.
Publisher resources
Table of contents
- Dedication
- Foreword to the Third Edition
- Foreword to the Fourth Edition
- Preface
-
I. The awk Language
- 1. Getting Started with awk
- 2. Running awk and gawk
- 3. Regular Expressions
-
4. Reading Input Files
- How Input Is Split into Records
- Examining Fields
- Nonconstant Field Numbers
- Changing the Contents of a Field
- Specifying How Fields Are Separated
- Reading Fixed-Width Data
- Defining Fields by Content
- Multiple-Line Records
-
Explicit Input with getline
- Using getline with No Arguments
- Using getline into a Variable
- Using getline from a File
- Using getline into a Variable from a File
- Using getline from a Pipe
- Using getline into a Variable from a Pipe
- Using getline from a Coprocess
- Using getline into a Variable from a Coprocess
- Points to Remember About getline
- Summary of getline Variants
- Reading Input with a Timeout
- Directories on the Command Line
- Summary
-
5. Printing Output
- The print Statement
- print Statement Examples
- Output Separators
- Controlling Numeric Output with print
- Using printf Statements for Fancier Printing
- Redirecting Output of print and printf
- Special Files for Standard Preopened Data Streams
- Special Filenames in gawk
- Closing Input and Output Redirections
- Summary
-
6. Expressions
- Constants, Variables, and Conversions
- Operators: Doing Something with Values
- Truth Values and Conditions
- Function Calls
- Operator Precedence (How Operators Nest)
- Where You Are Makes a Difference
- Summary
- 7. Patterns, Actions, and Variables
- 8. Arrays in awk
- 9. Functions
-
II. Problem Solving with awk
- 10. A Library of awk Functions
-
11. Practical awk Programs
- Running the Example Programs
- Reinventing Wheels for Fun and Profit
-
A Grab Bag of awk Programs
- Finding Duplicated Words in a Document
- An Alarm Clock Program
- Transliterating Characters
- Printing Mailing Labels
- Generating Word-Usage Counts
- Removing Duplicates from Unsorted Text
- Extracting Programs from Texinfo Source Files
- A Simple Stream Editor
- An Easy Way to Use Library Functions
- Finding Anagrams from a Dictionary
- And Now for Something Completely Different
- Summary
-
III. Moving Beyond Standard awk with gawk
- 12. Advanced Features of gawk
- 13. Internationalization with gawk
- 14. Debugging awk Programs
- 15. Arithmetic and Arbitrary-Precision Arithmetic with gawk
-
16. Writing Extensions for gawk
- Introduction
- Extension Licensing
- How It Works at a High Level
- API Description
- How gawk Finds Extensions
- Example: Some File Functions
-
The Sample Extensions in the gawk Distribution
- File-Related Functions
- Interface to fnmatch()
- Interface to fork(), wait(), and waitpid()
- Enabling In-Place File Editing
- Character and Numeric values: ord() and chr()
- Reading Directories
- Reversing Output
- Two-Way I/O Example
- Dumping and Restoring an Array
- Reading an Entire File
- Extension Time Functions
- API Tests
- The gawkextlib Project
- Summary
-
IV. Appendices
- A. The Evolution of the awk Language
- B. Installing gawk
- C. GNU General Public License
- Index
- Colophon
- Copyright
Product information
- Title: Effective awk Programming, 4th Edition
- Author(s):
- Release date: March 2015
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781491904619
You might also like
book
Building Microservices, 2nd Edition
As organizations shift from monolithic applications to smaller, self-contained microservices, distributed systems have become more fine-grained. …
book
Learning Go
Go is rapidly becoming the preferred language for building web services. While there are plenty of …
book
Learning TypeScript
TypeScript has conquered the world of JavaScript: it's one of the world's fastest growing and most …
book
Clean Architecture: A Craftsman's Guide to Software Structure and Design
Building upon the success of best-sellers The Clean Coder and Clean Code, legendary software craftsman Robert …