This is why I want any ML device to be able to explain itself. It could train on your before-and-after examples and come up with a list of what it thinks you want it to do.
For your example, it could list:
“Remove interior spaces from each item”
or it could say:
“Remove the middle character from any 7-character strings to make them 6 characters in length”
For your example, it could list:
or it could say: You would be able to do something with that.