Larry Gray MMEES Hw07

advertisement
Larry Gray
Hw07
MMEES
Oct 28, 2014
1) Barnsley, Chapter 3 exercises using the GAWK program
Exercise 3.1: Updated the “selcols.awk” program by inserting commas between fields being printed.
Result is that the fields being printed are separated with a space between each field
Exercise 3.2 Run “selcols3.awk” on the data in “rain98le.dat” and confirm that output is the same as
that shown in Figure 3.4. The program concatenates the year, month, day and hour of day rainfall
measured. The last column represents the rainfall measured in millemeters.
Without new line character “\n”
Role of “\n” puts each data record on a new line
Exercise 3.3: Using text editor, write a gawk program to process the file “temp98le.dat” so that output
is similar to the contents of the file called “le98temp.dat”. Run the program on the command line,
redirecting the output to a new file “le98temp.out”. Visualiz the results in gnuplot and confirm that the
plot is similar to that shown in Figure 2.8
Format of le98temp.dat
Format of newly created le98temp.out
GAWK program “selcolstp.awk” developed to process data format from “temp98le.dat” to that shown in
“le98temp.out” on the right above.
Input file “temp98le.dat” showing the complete data fields in the file from which the above shown
“le98temp.out” on the right side was created.
Using Gnuplot, the temperature graph is created,
Download