#!/usr/bin/perl # Anvil 2 FORM1 # # This scripts takes a .anvil file as an arugment # and converts it to the .form1 file format. # # Chris Osborn # cosborn@ldc.upenn.edu # # FORM Project, Linguistic Data Consortium # University of Pennsylvania # # http://www.ldc.upenn.edu/Projects/FORM/ # use Graph; print "\n"; #all hashes,maps,etc $labelMap{"Upper arm lift"} = "Lift"; $labelMap{"Relative elbow position"} = "RelElbow"; $labelMap{"Bicep: Inward/Outward"} = "BicepIO"; $labelMap{"Bicep: Upward/Downward"} = "BicepUD"; $labelMap{"Bicep: Forward/Backward"} = "BicepFB"; $labelMap{"Linear movement (X plane)"} = "XMove"; $labelMap{"Linear movement (Y plane)"} = "YMove"; $labelMap{"Linear movement (Z plane)"} = "ZMove"; $labelMap{"Upper arm rotation"} = "UArmRotMove"; $labelMap{"Rotation direction"} = "RotDirMove"; $labelMap{"Arc-like movement"} = "ArcMove"; $labelMap{"Circular movement"} = "CircleMove"; $labelMap{"Effort"} = "Effort"; $labelMap{"Elbow flexion"} = "Elbow"; $labelMap{"Forearm orientation"} = "Forearm"; $labelMap{"Elbow flexion change"} = "ElbowMove"; $labelMap{"Forearm rotation"} = "ForearmMove"; $labelMap{"Handshape group"} = "Group"; $labelMap{"Handshape letter"} = "Letter"; $labelMap{"Tension"} = "Tension"; $labelMap{"Wrist bend: up and down"} = "UpDown"; $labelMap{"Wrist bend: side to side"} = "SideSide"; $labelMap{"Part of body touched"} = "BodyPart"; $labelMap{"Hand movement"} = "HandMove"; $labelMap{"Wrist up-down movement"} = "UpDownMove"; $labelMap{"Wrist side-to-side movement"} = "SideSideMove"; $labelMap{"Finger coordination"} = "Finger"; $labelMap{"Excursionduration"} = "Duration"; $liftValMap[1] = 0; $liftValMap[2] = 22.5; $liftValMap[3] = 45; $liftValMap[4] = 67.5; $liftValMap[5] = 90; $liftValMap[6] = 112.5; $liftValMap[7] = 135; $liftValMap[8] = 157.5; $liftValMap[9] = 180; $relElbowValMap[1] = 160; $relElbowValMap[2] = 135; $relElbowValMap[3] = 90; $relElbowValMap[4] = 45; $relElbowValMap[5] = 0; $relElbowValMap[6] = -45; $relElbowValMap[7] = -90; $UArmRotMoveValMap[1] = 22.5; $UArmRotMoveValMap[2] = 45; $UArmRotMoveValMap[3] = 67.5; $UArmRotMoveValMap[4] = 90; $UArmRotMoveValMap[5] = 112.5; $UArmRotMoveValMap[6] = 135; $UArmRotMoveValMap[7] = 157.5; $UArmRotMoveValMap[8] = 180; $UArmRotMoveValMap[9] = 202.5; $elbowValMap[1] = 22.5; $elbowValMap[2] = 45; $elbowValMap[3] = 67.5; $elbowValMap[4] = 90; $elbowValMap[5] = 112.5; $elbowValMap[6] = 135; $elbowValMap[7] = 157.5; $elbowValMap[8] = 180; #change these $foreValMap[1] = -90; $foreValMap[2] = -45; $foreValMap[3] = 0; $foreValMap[4] = 45; $foreValMap[5] = 90; $foreValMap[6] = 90; $foreValMap[7] = 90; $elbowMoveValMap[1] = 22.5; $elbowMoveValMap[2] = 45; $elbowMoveValMap[3] = 67.5; $elbowMoveValMap[4] = 90; $elbowMoveValMap[5] = 112.5; $elbowMoveValMap[6] = 135; $elbowMoveValMap[7] = 157.5; $elbowMoveValMap[8] = 180; $shapeValMap{"NS"} = 0; $shapeValMap{"0A"} = 1; $shapeValMap{"0B"} = 2; $shapeValMap{"0C"} = 3; $shapeValMap{"0D"} = 4; $shapeValMap{"0E"} = 5; $shapeValMap{"0F"} = 6; $shapeValMap{"1A"} = 7; $shapeValMap{"1B"} = 8; $shapeValMap{"1C"} = 9; $shapeValMap{"1D"} = 10; $shapeValMap{"1E"} = 11; $shapeValMap{"1F"} = 12; $shapeValMap{"1G"} = 13; $shapeValMap{"1H"} = 14; $shapeValMap{"2A"} = 15; $shapeValMap{"2B"} = 16; $shapeValMap{"2C"} = 17; $shapeValMap{"2D"} = 18; $shapeValMap{"2E"} = 19; $shapeValMap{"2F"} = 20; $shapeValMap{"2G"} = 21; $shapeValMap{"2H"} = 22; $shapeValMap{"2I"} = 23; $shapeValMap{"2J"} = 24; $shapeValMap{"2K"} = 25; $shapeValMap{"3A"} = 26; $shapeValMap{"3B"} = 27; $shapeValMap{"3C"} = 28; $shapeValMap{"3D"} = 29; $shapeValMap{"3E"} = 30; $shapeValMap{"3F"} = 31; $shapeValMap{"4A"} = 32; $shapeValMap{"5A"} = 33; $shapeValMap{"5B"} = 34; $shapeValMap{"5C"} = 35; $shapeValMap{"5D"} = 36; $shapeValMap{"5E"} = 37; $shapeValMap{"5F"} = 38; $shapeValMap{"5G"} = 39; $shapeValMap{"5H"} = 40; $shapeValMap{"5I"} = 41; $shapeValMap{"5J"} = 42; $shapeValMap{"6A"} = 43; $shapeValMap{"6B"} = 44; $shapeValMap{"6C"} = 45; $shapeValMap{"6D"} = 46; $shapeValMap{"6E"} = 47; $shapeValMap{"6F"} = 48; $shapeValMap{"6G"} = 49; $shapeValMap{"6H"} = 50; $shapeValMap{"6I"} = 51; $upDownValMap[1] = 85; $upDownValMap[2] = 42.5; $upDownValMap[3] = 0; $upDownValMap[4] = -42.5; $upDownValMap[5] = -85; $sideSideValMap[1] = 22.5; $sideSideValMap[2] = 0; $sideSideValMap[3] = -22.5; $sideSideValMap[4] = -45; $timeFormat = "%.3f"; ### This is to easily adjust the time-stamp tolerance. $fps = 29.97; $spf = 1/$fps; $interFlag = 1; ### interpolation parameter, 0=off, 1(default)=on $lastFrame = 0; #default last frame, only used for first comparison $firstRFrame = 100000; #default first frame for right hand, only used for first comparison $firstLFrame = 100000; #default first frame for left hand, only used for first comparison #general rounding function sub round { $_[0] > 0 ? int $_[0] + 0.5 : int $_[0] - 0.5 } ### one-dimensional interpolation function ### args: int $tS ($_[0]), int $tE ($_[1]), real $valS ($_[2]), real $valE ($_[3]) ### return: list of interpolated values from $valS to $valE with size $tE-$tS sub interpolate{ my $tS = $_[0]; my $tE = $_[1]; my $valS = $_[2]; my $valE = $_[3]; my $timeDiff = $tE - $tS; my $valDiff = $valE - $valS; my $valInc = $valDiff/$timeDiff; for(my $i=1; $i<=$timeDiff; $i++){ $valArray[$i-1] = $valS + ($valInc*$i); } return @valArray; } #command line parsing, supports -f and -n for(my $i=0; $i<$#ARGV; $i++){ if($ARGV[$i] =~ /-\w/){ $ARGV[$i] =~ s/-//; $paraName = $ARGV[$i]; $paraVal = $ARGV[$i+1]; ARG: { if($paraName =~ /f/){ #-f FPS, different frame rate if($paraVal !~ /^[\d.]*?$/){ print "Invalid frame rate.\n"; $paraCounter = $paraCounter+2; $fFlag = 1; }else{ $fps = $paraVal; $spf = 1/$fps; $paraCounter = $paraCounter+2; $fFlag = 1; } last ARG; } if($paraName =~ /n/){ #-n, no interpolation $interFlag = 0; $paraCounter++; last ARG; } print "-$ARGV[$i] is an invalid parameter.\n"; $paraCounter++; } }else{ if($fFlag == 0){ if($ARGV[$i] !~ /.anvil/){ print "$ARGV[$i] is an invalid parameter.\n"; $paraCounter++; } }else{ $fFlag = 0; } } } for(my $i=0; $i<$paraCounter; $i++){ shift(@ARGV); } ### This reads in the files and create the annotation graphs for each annotator. $graphCounter = 0; foreach $file (@ARGV){ open (FILE, "./$file"); #open up file from args $fileName = $file; $fileName =~ s/.anvil//g; #remove .anvil extension $noIName = "$fileName"."NoI.form1"; #temp file name for non-interpolated files $IName = "$fileName".".form1"; #temp file name for interpolated files $graphCounter++; $annotationGraph{$graphCounter} = Graph->new(); while () { $line = $_; ### The following extracts the trackname, which will be part of the edge name if ($line =~ /track name/) { ($trackName) = ($line =~ /track name="(.*?)"/); $trackName =~ s/ //g; ($highLevel,$midLevel,$lowLevel) = (split(/\./, $trackName)); } ### This sets the nodes if ($line =~ //); $start = sprintf("$timeFormat",$start); $end = sprintf("$timeFormat",$end); if($armFlag == 0){ if($start < $firstRFrame){ $firstRFrame = $start; $firstRFrameEnd = $end; } $tempEnd = $end-1; if($tempEnd > $lastRFrame){$lastRFrame = $tempEnd;} } if($armFlag == 1){ if($start < $firstLFrame){ $firstLFrame = $start; $firstLFrameEnd = $end; } if($tempEnd > $lastRFrame){$lastRFrame = $tempEnd;} } $annotationGraph{$graphCounter}->add_edge( "$start", "$end"); if ($trackName =~ /duration/){ $attribute = "Excursionduration"; $value = "NA"; $totalAttribute = "$trackName" . "::$attribute" . "::$start" . "::$end"; $annotationGraph{$graphCounter}->set_attribute($totalAttribute,$start,$end,$value); } } ### This sets the names of the edges if ($line =~ /(.*?)set_attribute($totalAttribute,$start,$end,$value); } } close (FILE); } $arcCounter = 0; #sets frame bounds for Right and Left Arms if($lastRFrame > $lastLFrame){$lastFrame = $lastRFrame;} else{$lastFrame = $lastLFrame;} $frames = ($lastFrame - $firstFrame)*$fps; $firstRFrame = round($firstRFrame*$fps); $firstLFrame = round($firstLFrame*$fps); $lastRFrame = round($lastRFrame*$fps); $lastLFrame = round($lastRFrame*$fps); $boundHash{"firstRFrame"} = $firstRFrame; $boundHash{"firstLFrame"} = $firstLFrame; $boundHash{"lastRFrame"} = $lastRFrame; $boundHash{"lastLFrame"} = $lastLFrame; foreach $graph (keys %annotationGraph){ my $u, $v; my @vertices = sort {$a <=> $b} $annotationGraph{$graph}->vertices; foreach $u (@vertices){ my @successors = $annotationGraph{$graph}->successors($u); undef %singular; foreach $v (@successors){ if (!$singular{$v}){ $singular{$v} = 1; %attributes = $annotationGraph{$graph}->get_attributes($u, $v); foreach $totalAttribute (sort keys %attributes){ $arcKey = "$u" . "::$v" . "::$totalAttribute" . "::$attributes{$totalAttribute}"; ($armName, $track, $label, $tStart, $tEnd) = ($totalAttribute =~ /^(.*?)\.(.*?)::(.*?)::(.*?)::(.*?)$/); if($armName =~ /Right/){$hand = "R";} else{$hand = "L";} if ($track =~ /UpperArm\.Movement/){$moveFlag = 0} #following data is for UpperArm Movement track if ($track =~ /Forearm\.Movement/){$moveFlag = 1} #following data is for Forearm Movement track if ($track =~ /HandandWrist\.Movement/){$moveFlag = 2} #following data is for HandAndWrist Movement track $label = $labelMap{$label}; if($label =~ /\w/){ if($label =~ /Effort/){ if($moveFlag == 0){$move = "Arm"} elsif($moveFlag == 1){$move = "Fore"} elsif($moveFlag == 2){$move = "Hand"} } else{$move = ""} $label = "$hand"."$move"."$label"; my $val = $attributes{$totalAttribute}; ($num) = ($val =~ /^(\d*?)\./); $frameStamp = round($tStart*$fps); $frameEnd = round($tEnd*$fps); $fDiff = $frameEnd - $frameStamp; if($label =~ /Duration/){ $labelHash{$label}{$frameStamp} = 0; $labelHash{$label}{$frameEnd-1} = 1; }else{ if($label !~ /Letter/ && $label !~ /Effort/){$tempVal = $num;} else{$tempVal = $val;} if($fDiff > 1){ for(my $i=$frameStamp; $i<$frameEnd; $i++){ $labelHash{$label}{$i} = $tempVal; #if($label =~ /Effort/){print "$i :: $label :: $tempVal\n";} } }else{ $labelHash{$label}{$frameStamp} = $tempVal; } } } $arcCounter++; $graphList[$graph]{$arcKey}++; } } } } } #-------------------------------- #interpolation #-------------------------------- @labelArray = ("Lift","RelElbow","UArmRotMove","Elbow","Forearm","ElbowMove","UpDown","SideSide"); #list of arms @armArray = ("R","L"); #interpolation is on if($interFlag == 1){ #iterate for each arm foreach $arm (@armArray){ #set all "last-encountered" values to "" foreach my $name (@labelArray){ $lastLabel = "$arm"."$name"; $lastHash{$lastLabel} = ""; } #crete labels to index bounds hash my $firstFrameLabel = 'first'."$arm".'Frame'; my $lastFrameLabel = 'last'."$arm".'Frame'; #step through appropriate frames, from first to last for(my $i=$boundHash{$firstFrameLabel}; $i<$boundHash{$lastFrameLabel}; $i++){ $durationLabel = "$arm"."Duration"; if($labelHash{$durationLabel}{$i} eq 0){ foreach my $name (@labelArray){ $lastLabel = "$arm"."$name"; $lastHash{$lastLabel} = ""; $lasttSHash{$lastLabel} = ""; #$tempHash{$lastLabel} = ""; } } foreach my $name (@labelArray){ $labelName = "$arm"."$name"; $tempHash{$labelName} = $labelHash{$labelName}{$i}; if($labelName =~ /Lift/){$tempHash{$labelName} = $liftValMap[$tempHash{$labelName}];} elsif($labelName =~ /RelElbow/){$tempHash{$labelName} = $relElbowValMap[$tempHash{$labelName}];} elsif($labelName =~ /UArmRotMove/){$tempHash{$labelName} = $UArmRotMoveValMap[$tempHash{$labelName}];} elsif($labelName =~ /Elbow/){$tempHash{$labelName} = $elbowValMap[$tempHash{$labelName}];} elsif($labelName =~ /Forearm/){$tempHash{$labelName} = $foreValMap[$tempHash{$labelName}];} elsif($labelName =~ /ElbowMove/){$tempHash{$labelName} = $elbowMoveValMap[$tempHash{$labelName}];} elsif($labelName =~ /UpDown/){$tempHash{$labelName} = $upDownValMap[$tempHash{$labelName}];} elsif($labelName =~ /SideSide/){$tempHash{$labelName} = $sideSideValMap[$tempHash{$labelName}];} if(($tempHash{$labelName} ne "") && ($lastHash{$labelName} ne "")){ $temptempHash = $tempHash{$labelName}; $templastHash = $lastHash{$labelName}; $templasttSHash = $lasttSHash{$labelName}; $ArrHash{$labelName} = [interpolate($lasttSHash{$labelName}, $i, $lastHash{$labelName}, $tempHash{$labelName})]; for(my $j=$lasttSHash{$labelName}; $j<$i; $j++){ $temp2 = $ArrHash{$labelName}[$j-$lasttSHash{$labelName}]; $labelHash{$labelName}{$j+1} = $temp2; } }else{$labelHash{$labelName}{$i} = $tempHash{$labelName};} if($tempHash{$labelName} ne ""){ $lastHash{$labelName} = $tempHash{$labelName}; $lasttSHash{$labelName} = $i; } } } } } #-------------------------------- #-------------------------------- if($interFlag == 1){ open(OUT, ">./$IName"); print OUT "#$IName\n\n"; }else{ open(OUT, ">./$noIName"); print OUT "#$noIName\n\n"; } foreach $arm (@armArray){ if($arm =~ /R/){print OUT "#Right Hand\n#------------\n";} else{print OUT "#Left Hand\n#------------\n";} $gestureFlag = 0; my $firstFrameLabel = 'first'."$arm".'Frame'; my $lastFrameLabel = 'last'."$arm".'Frame'; $liftLabel = "$arm"."Lift"; $relElbowLabel = "$arm"."RelElbow"; $bicepIOLabel = "$arm"."BicepIO"; $bicepUDLabel = "$arm"."BicepUD"; $bicepFBLabel = "$arm"."BicepFB"; $XMoveLabel = "$arm"."XMove"; $YMoveLabel = "$arm"."YMove"; $ZMoveLabel = "$arm"."ZMove"; $UArmRotMoveLabel = "$arm"."UArmRotMove"; $rotDirMoveLabel = "$arm"."RotDirMove"; $arcMoveLabel = "$arm"."ArcMove"; $circleMoveLabel = "$arm"."CircleMove"; $armEffortLabel = "$arm"."ArmEffort"; $elbowLabel = "$arm"."Elbow"; $foreLabel = "$arm"."Forearm"; $elbowMoveLabel = "$arm"."ElbowMove"; $foreMoveLabel = "$arm"."ForearmMove"; $foreEffortLabel = "$arm"."ForeEffort"; $shapeLabel = "$arm"."Shape"; $groupLabel = "$arm"."Group"; $letterLabel = "$arm"."Letter"; $sideSideLabel = "$arm"."SideSide"; $upDownLabel = "$arm"."UpDown"; $bodyPartLabel = "$arm"."BodyPart"; $handMoveLabel = "$arm"."HandMove"; $sideSideMoveLabel = "$arm"."SideSideMove"; $upDownMoveLabel = "$arm"."UpDownMove"; $fingerLabel = "$arm"."Finger"; $handEffortLabel = "$arm"."HandEffort"; $tensionLabel = "$arm"."Tension"; for(my $i=$boundHash{$firstFrameLabel}; $i<$boundHash{$lastFrameLabel}; $i++){ $durationLabel = "$arm"."Duration"; $tempDuration = $labelHash{$durationLabel}{$i}; if($tempDuration eq 0){$gestureFlag = 1;} if($gestureFlag eq 1){ $tempLift = $labelHash{$liftLabel}{$i}; $tempRelElbow = $labelHash{$relElbowLabel}{$i}; $tempBicepIO = $labelHash{$bicepIOLabel}{$i}; $tempBicepUD = $labelHash{$bicepUDLabel}{$i}; $tempBicepFB = $labelHash{$bicepFBLabel}{$i}; $tempXMove = $labelHash{$XMoveLabel}{$i}; $tempYMove = $labelHash{$YMoveLabel}{$i}; $tempZMove = $labelHash{$ZMoveLabel}{$i}; $tempUArmRotMove = $labelHash{$UArmRotMoveLabel}{$i}; $tempRotDirMove = $labelHash{$rotDirMoveLabel}{$i}; $tempArcMove = $labelHash{$arcMoveLabel}{$i}; $tempCircleMove = $labelHash{$circleMoveLabel}{$i}; $tempArmEffort = $labelHash{$armEffortLabel}{$i}; $tempElbow = $labelHash{$elbowLabel}{$i}; $tempFore = $labelHash{$foreLabel}{$i}; $tempElbowMove = $labelHash{$elbowMoveLabel}{$i}; $tempForeMove = $labelHash{$foreMoveLabel}{$i}; $tempForeEffort = $labelHash{$foreEffortLabel}{$i}; $tempGroup = $labelHash{$groupLabel}{$i}; $tempLetter = $labelHash{$letterLabel}{$i}; $tempShape = $shapeValMap{"$tempGroup"."$tempLetter"}; $tempSideSide = $labelHash{$sideSideLabel}{$i}; $tempUpDown = $labelHash{$upDownLabel}{$i}; $tempBodyPart = $labelHash{$bodyPartLabel}{$i}; $tempHandMove = $labelHash{$handMoveLabel}{$i}; $tempSideSideMove = $labelHash{$sideSideMoveLabel}{$i}; $tempUpDownMove = $labelHash{$upDownMoveLabel}{$i}; $tempFinger = $labelHash{$fingerLabel}{$i}; $tempHandEffort = $labelHash{$handEffortLabel}{$i}; $tempTension = $labelHash{$tensionLabel}{$i}; if($interFlag eq 0){ #no interpolation mapping, so map appropriate values if($tempLift ne ""){$tempLift = sprintf("$timeFormat",$liftValMap[$tempLift]);} if($tempRelElbow ne ""){$tempRelElbow = sprintf("$timeFormat",$relElbowValMap[$tempRelElbow]);} if($tempUArmRotMove ne ""){$tempUArmRotMove = sprintf("$timeFormat",$UArmRotMoveValMap[$tempUArmRotMove]);} if($tempElbow ne ""){$tempElbow = sprintf("$timeFormat",$elbowValMap[$tempElbow]);} if($tempFore ne ""){$tempFore = sprintf("$timeFormat",$foreValMap[$tempFore]);} if($tempElbowMove ne ""){$tempElbowMove = sprintf("$timeFormat",$elbowMoveValMap[$tempElbowMove]);} if($tempSideSide ne ""){$tempSideSide = sprintf("$timeFormat",$sideSideValMap[$tempSideSide]);} if($tempUpDown ne ""){$tempUpDown = sprintf("$timeFormat",$upDownValMap[$tempUpDown]);} }else{ #interpolation, format values without mapping again if($tempLift ne ""){$tempLift = sprintf("$timeFormat",$tempLift);} if($tempRelElbow ne ""){$tempRelElbow = sprintf("$timeFormat",$tempRelElbow);} if($tempUArmRotMove ne ""){$tempUArmRotMove = sprintf("$timeFormat",$tempUArmRotMove);} if($tempElbow ne ""){$tempElbow = sprintf("$timeFormat",$tempElbow);} if($tempFore ne ""){$tempFore = sprintf("$timeFormat",$foreValMap[$tempFore]);} if($tempElbowMove ne ""){$tempElbowMove = sprintf("$timeFormat",$tempElbowMove);} if($tempSideSide ne ""){$tempSideSide = sprintf("$timeFormat",$tempSideSide);} if($tempUpDown ne ""){$tempUpDown = sprintf("$timeFormat",$tempUpDown);} } if($tempShape eq ""){$tempShape = 0}; if($tempTension eq ""){$tempTension = 0}; if($tempDuration eq 1){ #format last value of gesture (interpolation skips last value) if($tempLift ne ""){$tempLift = sprintf("$timeFormat",$liftValMap[$tempLift]);} if($tempRelElbow ne ""){$tempRelElbow = sprintf("$timeFormat",$relElbowValMap[$tempRelElbow]);} if($tempUArmRotMove ne ""){$tempUArmRotMove = sprintf("$timeFormat",$UArmRotMoveValMap[$tempUArmRotMove]);} if($tempElbow ne ""){$tempElbow = sprintf("$timeFormat",$elbowValMap[$tempElbow]);} if($tempFore ne ""){$tempFore = sprintf("$timeFormat",$foreValMap[$tempFore]);} if($tempElbowMove ne ""){$tempElbowMove = sprintf("$timeFormat",$elbowMoveValMap[$tempElbowMove]);} if($tempSideSide ne ""){$tempSideSide = sprintf("$timeFormat",$sideSideValMap[$tempSideSide]);} if($tempUpDown ne ""){$tempUpDown = sprintf("$timeFormat",$upDownValMap[$tempUpDown]);} } print OUT "$i,$tempLift,$tempRelElbow,$tempBicepIO,$tempBicepUD,$tempBicepFB,$tempXMove,$tempYMove,$tempZMove,$tempUArmRotMove,$tempRotDirMove,$tempArcMove,$tempCircleMove,$tempArmEffor,$tempElbow,$tempFore,$tempElbowMove,$tempForeMove,$tempForeEffort,$tempShape,$tempSideSide,$tempUpDown,$tempBodyPart,$tempHandMove,$tempSideSideMove,$tempUpDownMove,$tempFinger,$tempHandEffort,$tempTension\n"; if($tempDuration eq 1){ print OUT "#---end of gesture---\n"; $gestureFlag = 0; } } } } close(OUT); if($interFlag == 0){print "Done, output in $noIName\n\n";} else{print "Done, output in $fileName.form1\n\n";}