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

# $Author: jwagner $

# $Revision: 1.3 $
# $Date: 2000/02/28 15:48:23 $
# $Locker:  $

# Conversion of a simul output file into a simple StretchID-Csim(STPs) table.
# Only those Stretches are selected where a STP is connected (ie. where
# the Csim is not (-1|0, 0).
# Sample call:
#	gawk -f simSTP2db4.awk simulout.txt > CsimSTP.txt

BEGIN	{
	# Write first line for txt2dbf converter
	printf("StretchID	CsiminflM	CsiminflD	CsimefflM	CsimefflD\n")
	}

	{
	if ($8 > 0) {
		# tests for < 0 are just for safety reason
		printf("%d	%g	%g	%g	%g\n", $1,
			$8 < 0 ? 0 : $8,
			$9 < 0 ? 0 : $9,
			$10 < 0 ? 0 : $10,
			$11 < 0 ? 0 : $11)
	}
	}
