💾 Archived View for tranarchy.fish › ~autumn › awk › contents.gmi captured on 2023-04-19 at 22:55:47. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
<- Back to The AWK Programming Language
<h2 id="contents">CONTENTS</h2>
<ul>
<li>PREFACE</li>
<li>CHAPTER 1: AN AWK TUTORIAL
<ul>
<li>1.1 Getting Started
<ul>
<li>The Structure of an AWK Program</li>
<li>Running an AWK Program</li>
<li>Errors</li>
</ul></li>
<li>1.2 Simple Output
<ul>
<li>Printing Every Line</li>
<li>Printing Certain Fields</li>
<li>NF, the Number of Fields</li>
<li>Computing and Printing</li>
<li>Printing Line Numbers</li>
<li>Putting Text in the Output</li>
</ul></li>
<li>1 .3 Fancier Output
<ul>
<li>Lining Up Fields</li>
<li>Sorting the Output</li>
</ul></li>
<li>1.4 Selection
<ul>
<li>Selection by Comparison</li>
<li>Selection by Computation</li>
<li>Selection by Text Content</li>
<li>Combinations of Patterns</li>
<li>Data Validation</li>
<li>BEGIN and END</li>
</ul></li>
<li>1.5 Computing with AWK
<ul>
<li>Counting</li>
<li>Computing Sums and Averages</li>
<li>Handling Text</li>
<li>String Concatenation</li>
<li>Printing the Last Input Line</li>
<li>Built-in Functions</li>
<li>Counting Lines, Words, and Characters</li>
</ul></li>
<li>1.6 Control-Flow Statements
<ul>
<li>If-Else Statement</li>
<li>While Statement</li>
<li>For Statement</li>
</ul></li>
<li>1 .7 Arrays</li>
<li>1.8 A Handful of Useful “One-liners”</li>
<li>1.9 What Next?</li>
</ul></li>
<li>CHAPTER 2: THE AWK LANGUAGE
<ul>
<li>The Input File <code>countries</code></li>
<li>Program Format</li>
<li>2.1 Patterns
<ul>
<li>BEGIN and END</li>
<li>Expressions as Patterns</li>
<li>String-Matching Patterns</li>
<li>Regular Expressions</li>
<li>Compound Patterns</li>
<li>Range Patterns</li>
<li>Summary of Patterns</li>
</ul></li>
<li>2.2 Actions
<ul>
<li>Expressions</li>
<li>Control-Flow Statements</li>
<li>Empty Statement</li>
<li>Arrays</li>
</ul></li>
<li>2.3 User-Defined Functions</li>
<li>2.4 Output
<ul>
<li>The <code>print</code> Statement</li>
<li>Output Separators</li>
<li>The <code>printf</code> Statement</li>
<li>Output into Files</li>
<li>Output into Pipes</li>
<li>Closing Files and Pipes</li>
</ul></li>
<li>2.5 Input
<ul>
<li>Input Separators</li>
<li>Multiline Records</li>
<li>The <code>getline</code> Function</li>
<li>Command-Line Variable Assignments</li>
<li>Command-Line Arguments</li>
</ul></li>
<li>2.6 Interaction with Other Programs
<ul>
<li>The <code>system</code> Function</li>
<li>Making a Shell Command from an AWK Program</li>
</ul></li>
<li>2.7 Summary</li>
</ul></li>
<li>CHAPTER 3: DATA PROCESSING
<ul>
<li>3.1 Data Transformation and Reduction
<ul>
<li>Summing Columns</li>
<li>Computing Percentages and Quantiles</li>
<li>Numbers with Commas</li>
<li>Fixed-Field Input</li>
<li>Program Cross- Reference Checking</li>
<li>Formatted Output</li>
</ul></li>
<li>3.2 Data Validation
<ul>
<li>Balanced Delimiters</li>
<li>Password- File Checking</li>
<li>Generating Data-Validation Programs</li>
<li>Which Version of AWK?</li>
</ul></li>
<li>3.3 Bundle and Unbundle</li>
<li>3.4 Multiline Records
<ul>
<li>Records Separated by Blank Lines</li>
<li>Processing Multiline Records</li>
<li>Records with Headers and Trailers</li>
<li>Name-Value Data</li>
</ul></li>
<li>3.5 Summary</li>
</ul></li>
<li>CHAPTER 4: REPORTS AND DATABASES
<ul>
<li>4.1 Generating Reports
<ul>
<li>A Simple Report</li>
<li>A More Complex Report</li>
</ul></li>
<li>4.2 Packaged Queries and Reports
<ul>
<li>Form Letters</li>
</ul></li>
<li>4.3 A Relational Database System
<ul>
<li>Natural Joins</li>
<li>The relfile</li>
<li>q, an awk-like query language</li>
<li>qawk, a q-to-awk translator</li>
</ul></li>
<li>4.4 Summary</li>
</ul></li>
<li>CHAPTER 5: PROCESSING WORDS
<ul>
<li>5.1 Random Text Generation
<ul>
<li>Random Choices</li>
<li>Cliche Generation</li>
<li>Random Sentences</li>
</ul></li>
<li>5.2 Interactive Text-Manipulation
<ul>
<li>Skills Testing: Arithmetic</li>
<li>Skills Testing: Quiz</li>
</ul></li>
<li>5.3 Text Processing
<ul>
<li>Word Counts</li>
<li>Text Formatting</li>
<li>Maintaining Cross-References in Manuscripts</li>
<li>Making a KWIC Index</li>
<li>Making Indexes</li>
</ul></li>
<li>5.4 Summary</li>
</ul></li>
<li>CHAPTER 6: LITTLE LANGUAGES
<ul>
<li>6.1 An Assembler and Interpreter</li>
<li>6.2 A Language for Drawing Graphs</li>
<li>6.3 A Sort Generator</li>
<li>6.4 A Reverse-Polish Calculator</li>
<li>6.5 An Infix Calculator</li>
<li>6.6 Recursive-Descent Parsing</li>
<li>6.7 Summary</li>
</ul></li>
<li>CHAPTER 7: EXPERIMENTS WITH ALGORITHMS
<ul>
<li>7.1 Sorting
<ul>
<li>Insertion Sort</li>
<li>Quicksort</li>
<li>Heapsort</li>
</ul></li>
<li>7.2 Profiling</li>
<li>7.3 Topological Sorting
<ul>
<li>Breadth-First Topological Sort</li>
<li>Depth-First Search</li>
<li>Depth-First Topological Sort</li>
</ul></li>
<li>7.4 Make: A File Updating Program</li>
<li>7.5 Summary</li>
</ul></li>
<li>CHAPTER 8: EPILOG
<ul>
<li>8.1 AWK as a Language</li>
<li>8.2 Performance</li>
<li>8.3 Conclusion</li>
</ul></li>
<li>APPENDIX A: AWK SUMMARY</li>
<li>APPENDIX B: ANSWERS TO SELECTED EXERCISES</li>
<li>INDEX</li>
</ul>