#!/usr/local/bin/tcl
#
#
if {[llength $argv] == 0} {
	echo "Usage:  renumber <data_file_name>"
	exit 1
}
#
set infile [lindex $argv 0]
#
loadlibindex /usr/local/tcl/local/ucosyb.tlib
#
global debugs
set debugs {}
#
set newnum 1
#
set infile [lindex $argv 0]
set outfile $infile.renumber
set ofp [open $outfile w]
#
for_file line $infile {

	set flist [lreplace [split $line ~] 0 0]

	set newline "$newnum~[join $flist ~]"

	puts $ofp "$newline"

	incr newnum

}

close $ofp
#
