change last twp digits
From: Asif Iqbal (iqbala_at_qwestip.net)
Date: 01/05/04
- Next message: Rus Foster: "Re: Getting the total size of a directory"
- Previous message: J. Ryan: "As "there is more than one..." - how to solve my problem?"
- Next in thread: Asif Iqbal: "Re: change last twp digits"
- Reply: Asif Iqbal: "Re: change last twp digits"
- Reply: Rob Dixon: "Re: change last twp digits"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 4 Jan 2004 20:36:59 -0500 To: beginners@perl.org
Hi All
I am trying to relace any 7 digit number to to a new 7 digit number of
which last two digits are 9
lets pick a random 7 digit number as 1347236.
so I want 1347236 --> 1347299 using perl
I can do it with sed
NUMBER=1347236
NUMBER=`echo $NUMBER | sed 's/\([0-9]\{5\}\)[0-9]\{2\}/\199/'`
so now $NUMBER is 1347299
Any help/suggestion would be greatly appreciated
-- Asif Iqbal PGP Key: E62693C5 There's no place like 127.0.0.1
- application/pgp-signature attachment: stored
- Next message: Rus Foster: "Re: Getting the total size of a directory"
- Previous message: J. Ryan: "As "there is more than one..." - how to solve my problem?"
- Next in thread: Asif Iqbal: "Re: change last twp digits"
- Reply: Asif Iqbal: "Re: change last twp digits"
- Reply: Rob Dixon: "Re: change last twp digits"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]