Ebook The AWK Programming Language PDF

0

Deskripsi
Download ebook The AWK Programming Language PDF - Awk is a programming language that makes it possible to handle such tasks with very short programs, often only one or two lines long. An awk program is a sequence of patterns and actions that tell what to look for in the input data and what to do when it's found. Awk searches a set of files for lines matched by any of the patterns; when a matching line is found, the corresponding action is performed. A pattern can select lines by combinations of regular expressions and comparison operations on strings, numbers, fields, variables, and array elements. Actions may perform arbitrary processing on selected lines; the action language looks like C but there are no declarations, and strings and numbers are built-in data types.


Judul buku: The AWK Programming Language
Bahasa: Inggris
Tebal: 225 halaman
Format buku: PDF
Software: Sumatra PDF Reader
Ukuran: 7.8MiB

Download: Ebook The AWK Programming Language PDF


Daftar Isi

PREFACE

CHAPfER 1: AN A WK TUTORIAL
1.1 Getting Started

  • The Structure of an A WK Program 
  • Running an A WK Program 
  • Errors 


1.2 Simple Output

  • Printing Every Line 
  • Printing Certain Fields 
  • NF, the Number of Fields  
  • Computing and Printing 
  • Printing Line Numbers 
  • Putting Text in the Output 


1.3 Fancier Output

  • Lining Up Fields 
  • Sorting the Output 


1.4 Selection

  • Selection by Comparison 
  • Selection by Computation 
  • Selection by Text Content 
  • Combinations of Patterns 
  • Data Validation 
  • BEGIN and END 


1.5 Computing with AWK

  • Counting 
  • Computing Sums and Averages 
  • Handling Text 
  • String Concatenation 
  • Printing the Last Input Line 
  • Built-in Functions 
  • Counting Lines, Words, and Characters


1.6 Control-Flow Statements

  • If-Else Statement  
  • While Statement 
  • For Statement 


1.7 Arrays

1.8 A Handful of Useful "One-liners"

1.9 What Next?

CHAFfER 2: THE A WK LANGUAGE

  • The Input File countries 
  • Program Format 


2.1 Patterns

  • BEGIN and END 
  • Expressions as Patterns 
  • String-Matching Patterns 
  • Regular Expressions  
  • Compound Patterns 
  • Range Patterns 
  • Summary of Patterns  


2.2 Actions

  • Expressions 
  • Control-Flow Statements 
  • Empty Statement  
  • Arrays 


2.3 User-Defined Functions

2.4 Output

  • The print Statement 
  • Output Separators 
  • The printf Statement 
  • Output into Files 
  • Output into Pipes 
  • Closing Files and Pipes 


2.5 Input

  • Input Separators 
  • Multiline Records 
  • The getline Function 
  • Command-Line Variable Assignments 
  • Command-Line Arguments  


2.6 Interaction with Other Programs

  • The system Function 
  • Making a Shell Command from an AWK Program 


2. 7 Summary

CHAPTER 3: DATA PROCESSING
3.1 Data Transformation and Reduction

  • Summing Columns 
  • Computing Percentages and Quantiles 
  • Numbers with Commas 
  • Fixed-Field Input 
  • Program Cross-Reference Checking  
  • Formatted Output 


3.2 Data Validation

  • Balanced Delimiters 
  • Password-File Checking 
  • Generating Data-Validation Programs 
  • Which Version of AWK? 


3.3 Bundle and Unbundle

3.4 Multiline Records

  • Records Separated by Blank Lines 
  • Processing Multiline Records 
  • Records with Headers and Trailers 
  • Name-Value Data 


3.5 Summary

CHAPl'ER 4: REPORTS AND DATABASES
4.1 Generating Reports

  • A Simple Report 
  • A More Complex Report 


4.2 Packaged Queries and Reports

  • Form Letters 


4.3 A Relational Database System

  • Natural Joins  
  • The relfile 
  • q, an awk-like query language 
  • qawk, a q-to-awk translator 


4.4 Summary

CHAPTER 5: PROCESSING WORDS
5.1 Random Text Generation

  • Random Choices 
  • Cliche Generation 
  • Random Sentences 


5.2 Interactive Text-Manipulation

  • Skills Testing: Arithmetic  
  • Skills Testing: Quiz


5.3 Text Processing

  • Word Counts 
  • Text Formatting  
  • Maintaining Cross-References in Manuscripts 
  • Making a KWIC Index 
  • Making Indexes 


5.4 Summary

CHAP'fER 6: LITILE LANGUAGES
6.1 An Assembler and Interpreter

6.2 A Language for Drawing Graphs

6.3 A Sort Generator

6.4 A Reverse-Polish Calculator

6.5 An Infix Calculator

6.6 Recursive-Descent Parsing

6.7 Summary

CHAP'fER 7: EXPERIMENTS WITH ALGORITHMS
7.1 Sorting

  • Insertion Sort 
  • Quicksort 
  • Heapsort 


7.2 Profiling

7.3 Topological Sorting

  • Breadth-First Topological Sort  
  • Depth-First Search 
  • Depth-First Topological Sort 


7.4 Make: A File Updating Program

7.5 Summary

CHAP'fER 8: EPILOG
8.1 AWK as a Language

8.2 Performance

8.3 Conclusion

APPENDIX A: A WK SUMMARY

APPENDIX 8: ANSWERS TO SELECTED EXERCISES

INDEX


Posting Komentar

0 Komentar
* Please Don't Spam Here. All the Comments are Reviewed by Admin.