> perl -ne 's/([a-z]\d+)/$1/g;' <filename> > > It doesn't work, but if I use it in a script it works. > > I want to know where am I going wrong. Also I want to > know how to not get rid of digits at the beginning of > a line but the ones that follow some chars > > If input is like the one below, > > This23 > is > a > 45 > good > thing > > The result should be > > This > is > a > 45 > good > thing >
Try as, # perl -ne 'if ( ! /^\d+/ ) { s/[0-9]*$//;}print' test.log This is a 45 good thing hth. -Muthu -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>