Convert row to column

Hi,
I have a file like this

50      1       2       1374438
50      1       2       1682957
50      5       2       1453574
50      10     2       1985890
100      1       2       737307
100      5       2       1660204
100      10       2       2148483

and I want to convert this by gathering all 4th Col values to column vise with combination of Col1andCol2

50/1        50/5                    50/10                100/1       100/5               100/10 
1374438  1453574   1985890 737307  1660204            2148483
1682957                                   

The columns are separated by tab (Not in examples). I have 63 combinations of Col1/Col2 (50/1, 50/5 .... ) so hard coding is not a solution. Col3 is not in use so can ignore

Thanks in advance

The following script (called like ~/$ perl test.pl tmp.dat ) returns the result you require.

#!/usr/bin/perl

use strict;
use warnings;

my %table;
while(<>){
   my ($index_1,$index_2,$waste,$value)=split(/\s+/,$_);
   push @{$table{"$index_1/$index_2"}},$value;
}
my $rows=0;
$rows = $rows> $#{$table{$_}} ? $rows : $#{$table{$_}} for (keys %table);
print join( "",map {sprintf "%-11s", $_;} sort numeric_sort_col_header keys %table),"\n";
for my $index (0..$rows){
   for my $key (sort numeric_sort_col_header keys %table){
      printf "%-11s",($table{$key}->[$index]||"");
   }
   print "\n";
}
sub numeric_sort_col_header{
   my @A=split(/\//,$a);
   my @B=split(/\//,$b);
   $A[0]<=>$B[0]||$A[1]<=>$B[1]
}