I have two different files.
I need to merge these into one file. There is a common value. The two files have this format. The matches will not be in sequence. Dataset1 line1 may not match dataset2 line1. It is more likely dataset1 line1 will match dataset2 line16 or line 45.
Bold is the matching values. Any directional help will be appreciated.
BEEC,BE-EC,,154.7,46.07,,31.63,54.6,4833.6,5.06 BPLZ,BE-LZ,,390.6,62.62,,49.0,145.0,27.3,61.52 BFLP,BF-OP,,180.1,34.89,,40.0,58.26,8533.8,7.31 MRM1234-BEEC-1635753E001 25.6 70.29 MRM1234-BPLZ-1814737E003 8.12 18.13 MRM1234-BFLP-2470883E001 12.92 18.8
I know how to use a line.split to get the array of each element.
I know how to count into the first column L[6:4] of the second data set to get the matching 4 letter value.
I've tried several ways suggested but have not succeeded.
How do I merge all the columns in a single row joined by the unique 4 digit identifier? Matching of the unique value and then writing to one line eludes me.