C = {'Any string', NaN; ...
NaN, NaN; ...
'MAR', 'EECE'; ...
'PRODEGORY', 'TOOSTE'; ...
NaN, NaN; ...
'Another unknown string', 'CGATE'; ...
' CONSISIZE', 'COLG 75ML'; ...
' POPUIZE', 'no idea what this is'; ...
'Any string with 26 chars', 'SEDYNE'; ...
' CONSIZE', 'A string with 21 chars'; ...
'MAR', 'HYPEKETS'; ...
'PRODTEGORY', 'TOPASTE'};
match = find(strcmp(C(:, 1), 'MAR'));
C(match + 1, 2) = strcat({' '}, C(match, 2), {' '}, C(match + 1, 2));
You did not explain, where the spaces should come from, but I inserted them to match your example ' EECE TOOSTE'.
As you can see, fixing your example data took me more time than creating a solution.
Best Answer