Advertisement

05.01.2008 at 08:32AM PDT, ID: 23368924
[x]
Attachment Details

parsing a string using Shell script

Asked by saibsk in KornShell (ksh), Shell Scripting

How do I parse a string and retrieve the last 3 digits and add 4 to the start of the 3 digits

the string could be in following formats:

customer100
cust100

I need to retrieve the last 3 digits and add 4 to that. i.e 4100 in shell script. Please advise.Start Free Trial
 
Loading Advertisement...
 
[+][-]05.01.2008 at 08:59AM PDT, ID: 21479867

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.01.2008 at 01:27PM PDT, ID: 21482399

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: KornShell (ksh), Shell Scripting
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628