Data files
awk programs work with data. Programs can obtain data typed in from the workstation or from the output of other commands (for example, through pipes), but usually data is obtained from data files.
awk's data files are always text files (not binary files). The files contain readable text—for example, words, numbers, and punctuation characters.
As an example, consider a data file named hobbies,
which contains information on the hobbies of a group of people. Each
line in this file gives a person's name, one of that person's hobbies,
how many hours a week he or she spends on the hobby, and how much
money the hobby costs per year. One hobby per person appears on each
separate line. The file might look like this:
Figure 1. The hobbies file
Jim reading 15 100.00
Jim bridge 4 10.00
Jim role playing 5 70.00
Linda bridge 12 30.00
Linda cartooning 5 75.00
Katie jogging 14 120.00
Katie reading 10 60.00
John role playing 8 100.00
John jogging 8 30.00
Andrew wind surfing 20 1000.00
Lori jogging 5 30.00
Lori weight lifting 12 200.00
Lori bridge 2 0.00
This file is included with the z/OS UNIX shell as /samples/hobbies.