[dla.wizards] awk

zcf1025@dpscg1.UUCP (Regina Dawley) (09/27/89)

Hello World,
As a novice to the Awk programming language, i'm having a
problem with my script.
First, i'm reading a data file using the getline function;
Secondly, i'm assigning the data line to $0;
Next, i'm selecting the first 5 lines from another data file
using the head command and redirecting the output to a file.
Next, i want to print $0 and append it to the file containing the 5
lines. This statement does not execute.
Does anyone have an answer?  The script follows.

                                       Thanks
                                      Regina Dawley
                                   autovon 8-444-7508
                                   215-952-7508

zcf1025@dpscg1.UUCP (Regina Dawley) (09/27/89)

matchlines = 0
while ( getline < "temp.data" > 0) {
input[matchlines] = $0
system("head -5 < tale.data > tale.hdr")
print $0 >> tale.hdr
system("tail -29 < tale.data >> tale.hdr")
system("sprint tale.hdr")
matchlines++
}