/* ufh script to renumber records & traces: trace 1 = 9000 and increment by 10 for each seccessive trace record 1 = 2001 and increment by 2 for each seccessive record The script is run as follows: from disk files - ufh jo_ufh < input > output in a pipeline - ... | ufh jo_ufh | ... Note: the line header entries for the number of traces/record MUST be correct. */ func Begin () { /* initialize counters */ tstart = 8990; rcount = 1999; } func OnLineHeader () { /* read line header */ output (LH); /* output line header */ } func OnTrace () { /* read each input trace */ trc = Tr.TrcNum; /* get current trace number */ rec = Tr.RecNum; /* get current record number */ if (trc == 1) { /* at start of each record... */ rcount = rcount + 2; /* increment record counter by 2 */ tcount = tstart; /* reset trace counter */ } tcount = tcount + 10; /* increment trace counter by 10 */ Tr.TrcNum = tcount; /* put new trace number into header */ Tr.RecNum = rcount; /* put new record number into header */ output (Tr); /* output trace */ }