# $Source: /home/greatdev/src/models/simul/scripts/RCS/simul2db4.awk,v $

# $Author: jwagner $

# $Revision: 1.11 $
# $Date: 2000/02/28 15:44:36 $
# $Locker:  $

# Conversion of an simul output file into a simple LID-Csim table.
# Major work done is to get rid of many columns and to replace -1 by 0.
# Sample call:
#	gawk -f simul2db4.awk simulout.txt > Csim.txt

BEGIN	{
	# Write first line for txt2dbf converter
	printf("StretchID	CsimstartM	CsimstartD	CsimendM	CsimendD	CsimintM	CsimintD\n")
	}

	{
	printf("%d	%g	%g	%g	%g	%g	%g\n", $1,
		$2 < 0 ? 0 : $2, $3 < 0 ? 0 : $3, $4 < 0 ? 0 : $4, $5 < 0 ? 0 : $5, $6 < 0 ? 0 : $6, $7 < 0 ? 0 : $7)
	}
