I have two lists, which as a simple example can take the form:
l1 = {{a1,a2,a3},{b1,b2,b3},{c1,c2,c3}}
l2 = {{a1,n1},{c1,n2}}
How can I merge them by the first element in the list to obtain a list of the form
newList = {{a1,a2,a3,n1},{c1,c2,c3,n2}}.
I tried
GroupBy[Join[l1,l2],First->Last]
but this will only return the last elements of each (e.g. {{a1,a3,n1},{c1,c3,n2}, how do I keep all the elements? Thanks.