in reply to Two Column Data
Unix has a tool called join that solves these kinds of problems for you. Given the following data files:
inbndtrk1.txt:
1:B&O:101
2:B&O:102
inbndtrk2.txt:
1:CSXT:1001
2:CSXT:1002
The following command
will yield this output:join -t: -o{1,2}.{2,3} inbndtrk1.txt inbndtrk2.txt
B&O:101:CSXT:1001
B&O:102:CSXT:1002
Now, you can more easily format the results to whatever $client wants:
Output:join -t: -o{1,2}.{2,3} inbndtrk1.txt inbndtrk2.txt \ | perl -F: -ane'printf "%s %s | %s %s",@F'
B&O 101 | CSXT 1001
B&O 102 | CSXT 1002
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|