APPENDIX A: IMPORTING THE DIG FILES TO ARC/INFO
The inundation vector data were created by using the Erdas DIGSCRN module to screen
digitize the affected areas in the satellite images. The DIGSCRN module outputs vector data to
DIG files, which are formatted ASCII files. Each record of the DIG file contains 25 bytes. All
records are terminated with a semicolon, except for record 1, to pad each line to 25 bytes. The
ARC/INFO GENERATE command is used to import these data to an ARC/INFO coverage. But
first the data in the DIG format must be put in the correct format for the GENERATE command.
The GENERATE file needs a User-ID number for each line, followed by the series of x,y coordi-
nate pairs that define the line. The awk program, dig2gen, written by Bradley Quayle (CEMRO),
was used to put the data in the ARC/INFO GENERATE format:
BEGIN {cnt=1}
{
if (>0){
if(<0){
print cnt;}
else {
print "END";
cnt=cnt+1;
print cnt;
}
}
else {
print
||content||
,;
}
}
END {print "END";
print "END";}
The awk program is run with the DIG file as the input and the GENERATE file as the output. At
the UNIX prompt, type
$ awk -f dig2gen < dig_filename > generate_filename
where < and > are UNIX redirect operators. The output file will have the following format:
1
1.00,1.00;
2.00,2.00;
END
2
3.00,3.00;
4.00,4.00;
END
.
.
.
END
The semicolon comes from the end of the line in the DIG file and will have no effect on the
GENERATE command.
15