I want to find and replace a value inside awk block.Here is a sample input file to my scriptP110,9:11/18013013582,10:1,167:0,487:5/E.16411,9:15/310410532169026,10:60,167:0,487:4/IMSI12,18:15/013329002130500,19:015,9:10/9609610015,10:1,14:68,167:0,436:5/ABCDE,487:5/E.16416,87:117,9:10/8013765024,10:1,11:1,12:0,167:0,487:5/E.16423,9:11/13123149810,10:1,11:1,167:0,487:5/E.164P342,3:1.,4:3,300:1.43,3:1.,4:3,300:1.44,3:0.,4:7,300:0.45,5:0.3And here is the piece of code that I am currently using,nawk -v fname=${filename} -F '/|:' '    function isnum(x){return(x==x+0)}    /P1/,/P3/{            # Found start increment i reset variables go to next line            if(/P1/){                   ++i                    fid =                    count++                   next                }            # Found end validate variable and print go to next line            if(/P3/){                printf %s|,count                printf %s|,isnum(fid)?fid:NULL                  next                 }            if(!fid && /36,59:*/)                {                    fid = $NF                }        ' ${filename} >>output.txtBasically, I my input file will contain several P1/P3 blocks, I am taking one block at a time and finding out value from it. Now, what I want to basically do is change the value of first ,11:1 (i.e the one after 17,9 part) into 11:2 based on the value of 17,9:10/8013765024.Please note there can be several ,11 before and after but those have to remain unchanged.Please suggest how to proceed further. I am very new to both awk and sed.Also, I tried writing a regular expression but could not figure out it properly. Here it is,17[,0-9:\]*[\n]*,11
Finding and replacing text inside awk block
regular expression;bash;shell;awk;sed