Effective awk Programming (3rd Edition)
For anyone who writes scripts in the awk family of languages, the third edition ofEffective awk Programmingprovides 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 (likegrep,id, andsplit), 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 DraganTopics covered:Introduction to the awk programming languageRunning awk scriptsBasic file processingTutorial for regular expressionsStrategies for matching textDynamic regular expressionsParsing data into records and lines (including separating fields and handling multiple-line records)Usingprintandprintffor printed output with awk (including format specifiers)Redirecting awk scripts output to other processesBasic and advanced awk expressions (constants, variables, and function calls)PatternsShell variables and actionsArrays (including multidimensional arrays and sorting)Built-in and custom awk functionsInternationalizing and localizing awk scriptsAdvanced gawk (communicating with other processes and networking programming)Running awk and gawkSample awk scriptsInternetworking with awkHistory and evolution of awkDownloading and installing gawk