Find a line using a condition and replace a string in that line

Hello,
I have a 100 line code. I have given a sample of it below:

ABC*654654*1*54.54*21.2*87*1*654654654654
CCC*FS*FS*SFD*DSF
GGG*FGH*CGB*FBDFG*FGDG
ABC*654654*1*57.84*45.4*88*2*6546546545
CCC*WSF*SG*FGH*GHJ
ADA*AF*SFG*DFGH*FGH*FGTH

I need to select the line starting with "ABC" its 7th field should be replaced as 13
I result code should look like the one given below:

ABC*654654*1*54.54*21.2*87*13*654654654654
CCC*FS*FS*SFD*DSF
GGG*FGH*CGB*FBDFG*FGDG
ABC*654654*1*57.84*45.4*88*13*6546546545
CCC*WSF*SG*FGH*GHJ
ADA*AF*SFG*DFGH*FGH*FGTH

What have you tried so far? As a hint you might want to use awk . In your other threads you have lots of awk examples that should be sufficient for a start.

I am a beginer in awk. Will anyone try this out for me?

Ignoring me doesn't help. I will moderate any solutions until you show own effort to understand any of the solutions you got in your previous threads. Thanks for your understanding. Just the slightest sign of own effort will help :wink:

I'm not a frequent user of shell scripting as the need for shell scripting in my job is very rare. But i really wud love to learn awk and sed as i'm a fan of the speed and capability of them. As this is an urgent requirement i have posted in this forum. Please try this out and get me a result. :frowning:

If you want to learn then the best way is to at least make an attempt yourself, not for us to just give you a solution.

Excuse me, but you could have written the most utter not working code, but you did not even try and now demand a solution. So here we go:
----------------------------------------------------------------------------------------------------------------------------------------

Everyone at the UNIX and Linux Forums gives their best effort to reply to all questions in a timely manner. For this reason, posting questions with subjects like "Urgent!" or "Emergency" and demanding a fast reply are not permitted in the regular forums.

For members who want a higher visibility to their questions, we suggest you post in the Emergency UNIX and Linux Support Forum. This forum is given a higher priority than our regular forums.

Posting a new question in the Emergency UNIX and Linux Support Forum requires forum Bits. We monitor this forum to help people with emergencies, but we do not not guarantee response time or best answers. However, we will treat your post with a higher priority and give our best efforts to help you.

If you have posted a question in the regular forum with a subject "Urgent" "Emergency" or similar idea, we will, more-than-likely, close your thread and post this reply, redirecting you to the proper forum.

Of course, you can always post a descriptive subject text, remove words like "Urgent" etc. (from your subject and post) and post in the regular forums at any time.

Thank you.

The UNIX and Linux Forums