Guest User

Untitled

a guest
Nov 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. open (IN, "Table.txt") or die "cannot open file, $!n";
  2. open (OUT, ">short_table_2.txt");
  3. $head=<IN>;
  4. chomp $head;
  5. @h=split("t",$head);
  6. shift(@h);
  7. print "The values retained are: @h.n";
  8. print OUT "id,",join(","@h);
  9. $i=0;
  10. while (<IN>){
  11. $i++;
  12. chomp;
  13. @info=();
  14. unshift(@info,$i);
  15. print "The diameter of tree ",$i," is ",$info[1],"n";
  16. print OUT "n", join(",",@info);
  17. }
  18. close IN;
  19. close OUT;
Add Comment
Please, Sign In to add comment