- 论坛徽章:
- 0
|
- #!/usr/bin/perl
- use 5.010;
- @ARGV = qw/fileA fileB/;
- my $String_fileA = shift;
- my ( %Hash_key_string_value_array_of_string_fileB,
- %Hash_key_string_value_hashref_key_string_value_hashref_key_string_value_int_fileBFilter
- );
- while (<>) {
- my ( $String_one, $String_two, $String_three ) = split;
- push @{ $Hash_key_string_value_array_of_string_fileB{$String_one} },
- join "\t", $String_two, $String_three
- unless
- $Hash_key_string_value_hashref_key_string_value_hashref_key_string_value_int_fileBFilter{
- $String_one}{$String_two}{$String_three}++;
- }
- @ARGV = $String_fileA;
- while (<>) {
- chomp;
- my ( undef, $String_two, $String_three, $String_four ) =
- split /\s+/;
- next unless $Hash_key_string_value_array_of_string_fileB{$String_two};
- for ( @{ $Hash_key_string_value_array_of_string_fileB{$String_two} } ) {
- say $String_two, "\t", $String_three, "\t", $String_four, "\t", $_;
- }
- }
复制代码 |
|