I have an unusual merge request in awk. Hoping you could help.
File1
pl1,prop1,20
pl1,prop2,30
pl1,prop3,40
pl2,prop1,70
pl2,prop2,80
pl2,prop3,90
pl3,prop1,120
pl3,prop2,130
pl3,prop3,140
File2
store1,pl1
store2,pl1
store3,pl2
store4,pl3
store5,pl2
store6,pl1
Output:
prop1, store1-20, store2-20, store3-70, store4-120, store5-70, store6-20
prop2, store1-30, store2-30, store3-80, store4-130, store5-80, store6-30
prop3, store1-40, store2-40, store3-90, store4-140, store5-90, store6-40
Rules
- file1.column1 should match file2.column2
- for all matching lines - file2.column1 should be concatenated with file1.currentLine.column3 should be appended
Many thanks,