I have a string list constructed as follows:
lis = {"Abcdef","Ghij Kl"," GHI 01", " ABC 02"}
and would like to rearrange this to give:
res = {"Abcdef","02","Ghij Kl","01"}
This involves replacing the all-caps portion of the last two elements with the matching string that begins with the same characters, then splitting the revised third and fourth element to give res. [The white spaces in lis are intentional.]
Thanks for any thoughts!