#!/usr/bin/perl -w #file://videogamer06.pl #html table, appropriate rowspans. use strict; my %crap = (); my @all3; while() { @all3 = split(',',$_); push @{$crap{shift @all3}}, @all3; } foreach my $key (keys %crap) { print '$key-', @{$crap{$key}}, "\n"; } print "\n", '-' x 60, "\n"; foreach my $key (keys %crap) { print $key,"\t|"; my @twod = @{$crap{$key}}; print join("\t|", @twod); } print "\n", '-' x 60, "\n"; foreach my $key (keys %crap) { print $key; my @twod = @{$crap{$key}}; for my $ix (0..$#twod) { print "\t|", $twod[$ix]; } } #|csc|tech|base| #| |comp| | #| |mous|acm | __DATA__ csc, tech, base csc, comp, acm csc, mous, base #### #!/usr/bin/perl -w #file://www.kibo.com.pl use strict; my @all3=(); my %crap=(); while() { @all3 = split(',',$_); push @{$crap{shift @all3}}, \@all3; } foreach my $key (keys %crap) { print $key,"\t|\n"; my @twod = @{$crap{$key}}; foreach my $reference (@twod) { my @twod2 = @{$reference}; print "\t|", join("\t|", @twod2), "\n"; } print "\n",'-' x 79,"\n"; } __DATA__ a,3,4 a,30,04 a,300,004 a,3000,400 b,3,4 b,30,04 b,300,004 c,3000,400 #### #!/usr/bin/perl -w #file://working.snippet.pl use strict; my %crap = (); my @all3; while() { chomp; @all3 = split(',', $_ ); push @{$crap{shift @all3}}, \@all3; } print "\n", '-' x 60, "\n"; print "\n"; foreach my $key (keys %crap) { my @twod = @{$crap{$key}}; my $rowspan = 2+$#twod; my $colspan = 1+$#{$twod[0]}; print "\n"; print "\n"; for my $ref (@twod) { my @hef = @{$ref}; print "\n"; for my $hef (@hef) { print "\n"; } print "\n"; } } print "
\n", $key, " 
\n $hef \n
\n"; __DATA__ csc, tech, base csc, comp, acm csc, mous, base dcsc, mo0us, bas0e ecsc, mous, base csc, mou0s, baase bcsc, mo500us, 0bas0e bcsc, m4o0us, b0as0e bcsc, mo1us, ba0se bcsc, m2o0us, b0as0e