#! /usr/bin/perl

$FILE_rob_pos = "db/rob_pos.cache";

open( DB, $FILE_rob_pos ) || die "Error: could not open db file $FILE_rob_pos. Do make in db dir.";

while ( <DB> ) {

    if( /^(\S+)\s+(\d+)\s+(\d+)/ ) {

	#$ROC    = $1;
	$ROB_POS    = $2;
	$ROB_SERIAL = $3;
	# printf(" ROC=<$ROC>   POS=<$POS>  SERIAL=<$SERIAL>\n");

	$ROB_TYPE = -1;

	if( $ROB_POS == 0 ) { $ROB_TYPE = "1A"; }
	if( $ROB_POS == 1 ) { $ROB_TYPE = "1B"; }
	if( $ROB_POS == 2 ) { $ROB_TYPE = "1A"; }
	if( $ROB_POS == 3 ) { $ROB_TYPE = "2B"; }
	if( $ROB_POS == 4 ) { $ROB_TYPE = "3A"; }
	if( $ROB_POS == 5 ) { $ROB_TYPE = "3B"; }
	if( $ROB_POS == 6 ) { $ROB_TYPE = "4A"; }
	if( $ROB_POS == 7 ) { $ROB_TYPE = "4B"; }
	
	printf("dat/rob_%s_%s_%s.dat\n", $ROB_SERIAL, $ROB_TYPE, $ROB_POS);

    }

    #L1C0_017        3       0031    2006-01-03      KO      F0T2BV1N0031
}
