I am editing a large text array in vim, and I want to compute on one sub-column of it.
Simplified example of edited file:
name value name saturation
red 5 green 2
blue 7 yellow 7
other text
I want to pipe column 4 through an external program calc.pl, calc.pl replaces numbers with new numbers in the input, for example:
name value name saturation
red 5 green 2.4
blue 7 yellow 7.14
other text
When I select rectangle in column 4, using v.motion, and !perl calc.pl the whole lines gets piped to calc.pl, not just the rectangle.
A work around would be to: cut rectangle to temp file, run calc.pl on temp file, and then read output as rectangle.
Is there a straight forward solution in vim, without having to cut/shell/paste?