You can use the inbuilt calculator and/or the fact that \,
in the replacement string for commands like replace-regexp
will evaluate an arbitrary elisp expression.
More-or-less of the top of my head you can do:
A.
- Mark the region containing the numbers.
- Execute M-x replace-regexp
- For the matching regexp, use
\([[:digit:]]+\)
.
- For the replacement, use
\,(format "%X" (string-to-number \1))
.
B.
- Mark the region containing the numbers.
- Type C-x * g.
- Type V R +.
- Type y to insert the sum, or C-u y to replace.
C.
Same as for A, but mark just the last number, and use a replacement function of \,(format "%s\n%d" \1 (1+ (string-to-number \1)))
.
You can put these in macros or functions which take care of moving point around to the right place.