Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open (IN, "Table.txt") or die "cannot open file, $!n";
- open (OUT, ">short_table_2.txt");
- $head=<IN>;
- chomp $head;
- @h=split("t",$head);
- shift(@h);
- print "The values retained are: @h.n";
- print OUT "id,",join(","@h);
- $i=0;
- while (<IN>){
- $i++;
- chomp;
- @info=();
- unshift(@info,$i);
- print "The diameter of tree ",$i," is ",$info[1],"n";
- print OUT "n", join(",",@info);
- }
- close IN;
- close OUT;
Add Comment
Please, Sign In to add comment