FirstList = {{1, 2, x}, {2, 3, x}, {4, 2, x}, {x, 3, 5}, {x, 7, 8}};
SecondList = {a, b, c, d, e};
Table[
Replace[Part[FirstList, n], x -> Part[SecondList, n]], {n, Length[SecondList]}]
{{1, 2, x}, {2, 3, x}, {4, 2, x}, {x, 3, 5}, {x, 7, 8}}
I expected the output to be
{{1, 2, a}, {2, 3, b}, {4, 2, c}, {d, 3, 5}, {e, 7, 8}}
How do you make it so?