Re: one-liner for if condition is met, substitute an incremented number

2008-09-21 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Here's a string in my file, #define MY2D_STRING"4.0.1.999.9" of which I'm trying to increment the last digit; let's say with 1, such that the output is 4.0.1.999.10 I've tried _various_ combinations, here's just one of them. (This works partially, but not

Re: one-liner for if condition is met, substitute an incremented number

2008-09-21 Thread Mr. Shawn H. Corey
On Fri, 2008-09-19 at 20:53 -0700, [EMAIL PROTECTED] wrote: > Here's a string in my file, > > #define MY2D_STRING"4.0.1.999.9" > > of which I'm trying to increment the last digit; let's say with 1, > > such that the output is 4.0.1.999.10 > > I've tried _various_ combinations, here'

one-liner for if condition is met, substitute an incremented number

2008-09-21 Thread myperlfaq
Here's a string in my file, #define MY2D_STRING"4.0.1.999.9" of which I'm trying to increment the last digit; let's say with 1, such that the output is 4.0.1.999.10 I've tried _various_ combinations, here's just one of them. (This works partially, but not always). perl -i -pe 'if (