perl进行行列转置

use strict;
open IN,"<1.Book";
open OUT,">final.txt";
my $i=0;
my @data;
while(<IN>){
    chomp;
     my @line=split/\t/,$_;
     for my $k(0 .. $#line){
         $data[$k][$i]=$line[$k];
     }
     $i++;
 }
 close IN;
 for (@data){
 print OUT join("\t",@{$_}),"\n";
 }
    原文作者:南山欧巴
    原文地址: https://www.jianshu.com/p/f7bdee39d6cd
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞