■
HDBench のデータをmycpu.txt とか myvideo.txt に成形してくれるひと。
# -_-* perl *-_- use strict; use utf8; use Data::Dumper; $| = 1; my @lines = <>; my @datas = (); while(@lines) { $_ = shift @lines; chomp; s/^ +//; s/ +$//; if( /HDBENCH Ver 3.40 beta 6/ ) { my %topic; &HDBENCH3406(\%topic); push @datas,\%topic; } } # print Dumper [\@datas]; print <<__TEXT; ==================== === MYCPU.TXT ==== ==================== __TEXT foreach( @datas ) { print "$$_{Processor}\n"; print "$$_{Integer}\n"; print "$$_{Float}\n"; } print <<__TEXT; ==================== === MYVIDEO.TXT ==== ==================== __TEXT foreach( @datas ) { print "$$_{VideoCard}\n"; print "$$_{Processor}\n"; print "$$_{Rectangle}\n"; print "$$_{Text}\n"; print "$$_{Ellipse}\n"; print "$$_{BitBlt}\n"; } sub HDBENCH3406 { my $data = shift; my @topic = ( 'M/B Name', 'Processor', 'VideoCard', 'Resolution', 'Memory', 'OS', 'Date' ); my @key1 = qw/ ALL Integer Float MemoryR MemoryW MemoryRW DirectDraw /; my @key2 = qw/ Rectangle Text Ellipse BitBlt Read Write RRead RWrite Drive /; while(@lines) { $_ = shift @lines; chomp; s/^ +//; s/ +$//; next if( /^$/ ); foreach my $topic( @topic ) { # print "$topic : $'\n" if ( /^$topic\s+/x ) { # warn "$topic : $$data{$topic} to $'\n" if( $$data{$topic} and $$data{$topic} ne $' ); $$data{$topic} = $'; next; } } # # print "$_\n"; my @col = split(/\s+/, $_); my @diff = grep { !{map{$_,1}@key1 }-> {$_}}@col; unless( @diff ) { val(\@key1, $data); ; } my @diff = grep { !{map{$_,1}@key2 }-> {$_}}@col; unless( @diff ) { val(\@key2, $data); last; } } return; } sub val { my $key = shift; my $topic = shift; while(@lines) { $_ = shift @lines; chomp; s/^ +//; s/ +$//; my @col = split(/\s+/, $_); my $i = 0; foreach( @col ) { # print $$key[$i], "#" , $_, "\n"; $$topic{$$key[$i]} = $_; $i++; } last; } }