Help for this page

Select Code to Download


  1. or download this
    my $csv = Text::CSV_XS->new ({ binary => 1 });
    open my $dta, "<", "data.csv" or die "data: $!\n";
    my @rows;
    ...
    
    # pivot
    my @data = map { my $col = $_; join "|", map { $_->[$col] } @rows } 0.
    +.$#{$rows[0]};
    
  2. or download this
    123,foo,2,FOO
    234,bar,2,BAR
    345,zap,3,ZAP
    456,bok,5,BOK
    
  3. or download this
    (   "123|234|345|456",
        "foo|bar|zap|bok",
        "2|2|3|5",
        "FOO|BAR|ZAP|BOK")