You could pair the above with something like this general purpose mapColumn function for datasets, to update all the values in a particular column of the dataset as one operation:
You get less control over the boundary conditions, but you can also use our FormatUtil internal library to achieve the same result: