Home > other >  With perl, according to the same column with two files
With perl, according to the same column with two files

Time:10-11

The existing table 1 below:
A B C D E F G
1 a, 2, 3, 1 2 2
3 d 4 3 2 1 3
Table 2 is as follows:
B H I J K L M N
C 4 1, 2, 4, 5 6 7
A 1 2 3 4 5 6 7
D 2, 4, 5, 6 2, 3, 1
B column in the table 1 is a subset of the set of the B column in table 2, with the B column in table 1 and table 2 B column in the comparison, if the same will be the corresponding row of the table appended to the table 1 (different additional); Eventually form 3 format as follows (keep header A B... ) :
B A B C D E F G H I J K L M N
1 a, 2, 3, 1 2 3 4 5 6 7 1 2 2 a
3 d 4 3 2 1 3 d 2, 4, 5 6 2, 3, 1
Excuse me how to use perl implementation, thank you very much!!!!!

CodePudding user response:

Table 2 b column element and can be the counterpart of the other elements of the hash, in calendar time table 1, if the same output table 2 other elements, different output table 1,
  • Related