On Tue, Jul 11, 2006 at 10:55:12AM +0300, Erez D wrote:
> i have a text that looks like:
>
> 8+9 to 20
> 1+7 to 29
>
>
> and i want to change it to:
>
> 17 to 20
> 8 to 29
>
> (i.e. do the math)
>
>
> how do i do that in vi ?
One possible way is to use an external filter:
:%!perl -ane '$F[0] = eval $F[0]; print join(" ",@F)."\n"'
(which will probably soon be optimized by another list subscriber)
-- Tzafrir
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]