Sorry, for the broad title, didn't know how to best describe it. I have a list likes this:
list = {{{1, 2, 3, {4, 5, 6}}, {1, 2, 3, {4, 5, 6}}}, {{1, 2, 3, {4, 5, 6}}, {1, 2, 3, {4, 5, 6}}}} And I want to replace the second part of the list elements, i.e. {4,5,6} everywhere by just the first element of this part, i.e. 4. the list should then look like this:
list2 = {{{1, 2, 3, 4}, {1, 2, 3, 4}}, {{1, 2, 3, 4}, {1, 2, 3, 4}}} I can do it with some complicated constructions looping through all the list elements by means of Table but there must be an easier way by using Replace or MapAtand I just can't figure it out.
Any help appreciated!