Sed substitution possible with arithmetic involved?

Viewed 8980

File I need to modify contains the following:

block: 16, size: 16, start: 8, length: 4

I'd like the file so that values for block, size will be divided by 2 while values for start, length will be multiplied by 2.

Since I have to make such modifications for a whole bunch of files, I am considering using Sed to do the substitution work for me. But I'm not sure calculations are allowed in the matching and substituting process.

4 Answers
Related