############################################################################
# written by Gia McCue, harmoniccycle.com
# 1/25/03
########  Variables you should change are below  ###########################


$copycommand = "copy";
$deletecommand = "del";




######## END Variables - Start Program #####################################
print "\n\n\n\n\n";
print "vueEDIT.  \n  This program will renumber the frames in a .vue file. \n You may cut and paste paired lines in a .vue file in a text editor. \n vueEDIT will renumber the frames at any interval.\n";
print "\n\nIMPORTANT: Make sure this program is in the same directory as the file you would like to re-number.\n\n";

print "Enter the name of the .vue file you want to re number: ";
$file = <STDIN>;
chop ($file);

if(-e $file) {}
else {print "$file does not exist in this directory.\n Re-enter the name of the .vue file you want to re number:"; 
	$file = <STDIN>;
	chop ($file);
	}

print "Create a name for the re numbered .vue file. \n(Be sure to add the .vue extension.): ";
$newfile = <STDIN>; 
chop ($newfile);


print "Enter a frame interval: ";
$interval = <STDIN>;
chop ($interval);

$count = 0;
open(FILE, "$file");
open(TEMP, ">$newfile");
while(<FILE>)
	{
	$thisLine = $_;
	@split = split(/\s/, $thisLine);
	if(@split[1] !~ /\D/)
		{
		print TEMP "@split[0] $count\n";
		$count = $count + $interval;
		}
	else 	{print TEMP "$thisLine"; }
	
	}

print "$newfile created. Press any key to exit.\n ";
$exit = <STDIN>; 
