I have two huge input files:
file1
contains 3 tabulator separated fields:
field1
: UIDfield2
: usernamefield3
: Real Name
Example of file1
:
644 u11496 Real name1
640 u1309 Real name2
641 u3007 Real name3
642 u3030 Real name4
643 u3112 Real name5
54 u0365 Real name6
55 u0613 Real name7
56 u1065 Real name8
57 u1550 Real name9
file2
with many lines each one with 3 tabulator separated fields:
field1
: Can be ignored for this casefield2
: Group namefield3
: Column containing comma-separated UIDs of users
Example of file2
:
2 group1 14,730,748,733,746,761,757,766,735,760,747,738,752,737,758,755,734,754,764,334,335,336,337,41,338,339,39,340
6 group2 14
15 group3 14,667,683,713,730,707,748,733,746,761,680,694,757,766,717,735,760,747,704,738,752,737,715,688,681,700,692,758,755,714,734
I need to add to each user line in file1
, 4th column (tab-separated) with comma-separated group names which a particular user is member of.