replace with string present in Nth Line after a match in a line





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I have the script which is formatted as below.



here in my example i require to search for "Probable Cause:Unspecified" and once found i need to replace the line with 4th line below.



Actual output is :



Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Probable Cause: Unspecified reason
ack: blah blah blah
time: blah blah blah
Specific Event MOC: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


and once the string "Probable Cause: Unspecified reason" if found Probable Cause should be replaced with Specific Event MOC



final output required:



Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Specific Event MOC: Unspecified reason
ack: blah blah blah
time: blah blah blah
Probable Cause: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


please help










share|improve this question


















  • 1





    What have you tried? How did it fail?

    – choroba
    Nov 26 '18 at 20:33











  • awk '/"Cause: Unspecified"/{gsub("Probable Cause:","Specific Event MOC",$1)};{print $0}'. it gives me same output

    – Prayag
    Nov 26 '18 at 20:34













  • @Prayag The phrase to use for replacement is presumably not always Specific Event ...; that's just this example. The replacement is found three lines down from Probable Cause...

    – zdim
    Nov 26 '18 at 20:36













  • @zdim the Specific Event will always be three line down below the probable cause.

    – Prayag
    Nov 26 '18 at 20:39






  • 1





    yes. but not the contents after :... just the string Probable Cause with Specific Event MOC with each other.

    – Prayag
    Nov 26 '18 at 20:54


















1















I have the script which is formatted as below.



here in my example i require to search for "Probable Cause:Unspecified" and once found i need to replace the line with 4th line below.



Actual output is :



Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Probable Cause: Unspecified reason
ack: blah blah blah
time: blah blah blah
Specific Event MOC: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


and once the string "Probable Cause: Unspecified reason" if found Probable Cause should be replaced with Specific Event MOC



final output required:



Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Specific Event MOC: Unspecified reason
ack: blah blah blah
time: blah blah blah
Probable Cause: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


please help










share|improve this question


















  • 1





    What have you tried? How did it fail?

    – choroba
    Nov 26 '18 at 20:33











  • awk '/"Cause: Unspecified"/{gsub("Probable Cause:","Specific Event MOC",$1)};{print $0}'. it gives me same output

    – Prayag
    Nov 26 '18 at 20:34













  • @Prayag The phrase to use for replacement is presumably not always Specific Event ...; that's just this example. The replacement is found three lines down from Probable Cause...

    – zdim
    Nov 26 '18 at 20:36













  • @zdim the Specific Event will always be three line down below the probable cause.

    – Prayag
    Nov 26 '18 at 20:39






  • 1





    yes. but not the contents after :... just the string Probable Cause with Specific Event MOC with each other.

    – Prayag
    Nov 26 '18 at 20:54














1












1








1








I have the script which is formatted as below.



here in my example i require to search for "Probable Cause:Unspecified" and once found i need to replace the line with 4th line below.



Actual output is :



Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Probable Cause: Unspecified reason
ack: blah blah blah
time: blah blah blah
Specific Event MOC: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


and once the string "Probable Cause: Unspecified reason" if found Probable Cause should be replaced with Specific Event MOC



final output required:



Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Specific Event MOC: Unspecified reason
ack: blah blah blah
time: blah blah blah
Probable Cause: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


please help










share|improve this question














I have the script which is formatted as below.



here in my example i require to search for "Probable Cause:Unspecified" and once found i need to replace the line with 4th line below.



Actual output is :



Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Probable Cause: Unspecified reason
ack: blah blah blah
time: blah blah blah
Specific Event MOC: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


and once the string "Probable Cause: Unspecified reason" if found Probable Cause should be replaced with Specific Event MOC



final output required:



Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Specific Event MOC: Unspecified reason
ack: blah blah blah
time: blah blah blah
Probable Cause: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


please help







regex linux perl awk sed






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 26 '18 at 20:28









PrayagPrayag

629




629








  • 1





    What have you tried? How did it fail?

    – choroba
    Nov 26 '18 at 20:33











  • awk '/"Cause: Unspecified"/{gsub("Probable Cause:","Specific Event MOC",$1)};{print $0}'. it gives me same output

    – Prayag
    Nov 26 '18 at 20:34













  • @Prayag The phrase to use for replacement is presumably not always Specific Event ...; that's just this example. The replacement is found three lines down from Probable Cause...

    – zdim
    Nov 26 '18 at 20:36













  • @zdim the Specific Event will always be three line down below the probable cause.

    – Prayag
    Nov 26 '18 at 20:39






  • 1





    yes. but not the contents after :... just the string Probable Cause with Specific Event MOC with each other.

    – Prayag
    Nov 26 '18 at 20:54














  • 1





    What have you tried? How did it fail?

    – choroba
    Nov 26 '18 at 20:33











  • awk '/"Cause: Unspecified"/{gsub("Probable Cause:","Specific Event MOC",$1)};{print $0}'. it gives me same output

    – Prayag
    Nov 26 '18 at 20:34













  • @Prayag The phrase to use for replacement is presumably not always Specific Event ...; that's just this example. The replacement is found three lines down from Probable Cause...

    – zdim
    Nov 26 '18 at 20:36













  • @zdim the Specific Event will always be three line down below the probable cause.

    – Prayag
    Nov 26 '18 at 20:39






  • 1





    yes. but not the contents after :... just the string Probable Cause with Specific Event MOC with each other.

    – Prayag
    Nov 26 '18 at 20:54








1




1





What have you tried? How did it fail?

– choroba
Nov 26 '18 at 20:33





What have you tried? How did it fail?

– choroba
Nov 26 '18 at 20:33













awk '/"Cause: Unspecified"/{gsub("Probable Cause:","Specific Event MOC",$1)};{print $0}'. it gives me same output

– Prayag
Nov 26 '18 at 20:34







awk '/"Cause: Unspecified"/{gsub("Probable Cause:","Specific Event MOC",$1)};{print $0}'. it gives me same output

– Prayag
Nov 26 '18 at 20:34















@Prayag The phrase to use for replacement is presumably not always Specific Event ...; that's just this example. The replacement is found three lines down from Probable Cause...

– zdim
Nov 26 '18 at 20:36







@Prayag The phrase to use for replacement is presumably not always Specific Event ...; that's just this example. The replacement is found three lines down from Probable Cause...

– zdim
Nov 26 '18 at 20:36















@zdim the Specific Event will always be three line down below the probable cause.

– Prayag
Nov 26 '18 at 20:39





@zdim the Specific Event will always be three line down below the probable cause.

– Prayag
Nov 26 '18 at 20:39




1




1





yes. but not the contents after :... just the string Probable Cause with Specific Event MOC with each other.

– Prayag
Nov 26 '18 at 20:54





yes. but not the contents after :... just the string Probable Cause with Specific Event MOC with each other.

– Prayag
Nov 26 '18 at 20:54












2 Answers
2






active

oldest

votes


















1














Here is a 2 pass awk solution:



awk 'BEGIN{FS=OFS=":"}
FNR == NR {
r[FNR]=$1
next
}
/^Probable Cause:/ {
$1 = r[FNR+3]
n=FNR
}
FNR == n+3 && /^Specific Event / {
$1 = r[FNR-3]
} 1' file file




Serial : blah blah blah
A-TYPE: blah blah blah
O-type: blah blah blah
instance: blah blah blah
fault: blah blah blah
sev: blah blah blah
Specific Event MOC: Unspecified reason
ack: blah blah blah
time: blah blah blah
Probable Cause: blah blah blah
cause: blah blah blah
Specific Problem: blah blah blah


Explanation:





  • BEGIN block sets input and output field separators as :


  • FNR == NR: While processing file 1st time


  • r[FNR]=$1: Store first columns by key as their record no


  • next: Move to next record

  • Now awk will be processing file 2nd time


  • /^Probable Cause:/: When we find this text in a record


  • $1 = r[FNR+3]: Set 1st column as 1st column of 3rd record ahead from current


  • n=FNR: Store current record in variable n


  • FNR == n+3 && /^Specific Event /: When current record is n+3 and we get line starting with Specific Event


  • $1 = r[FNR-3]: Set 1st column as 1st column of 3rd previous record from current






share|improve this answer


























  • but i guess there will be two string of Probable Cause.. will be displayed out which is not matching with my final output as shown in my question

    – Prayag
    Nov 26 '18 at 21:01











  • sorry I had a mistake, try updated code now

    – anubhava
    Nov 26 '18 at 21:05






  • 1





    thanks Anubhava for the support . and also thanks to all for helping me out.is is possible to explain what exactly it is done by awk which you provided and what is the changes if i need to swap after a string is matched, like if Unspecified reason is found do the swapping in that line.

    – Prayag
    Nov 26 '18 at 21:09













  • I have modified my awk to make it more efficient and added detailed explanation.

    – anubhava
    Nov 26 '18 at 21:18






  • 1





    u r genius!!! . such precise explanation.

    – Prayag
    Nov 26 '18 at 21:24



















1














your data in 'd', by gnu sed;



sed -E '/^Probable Cause:/{N;N;N;s/([^:]+)(:.+n.+n.+n)([^:]+):(.+)/321/}' d





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53488562%2freplace-with-string-present-in-nth-line-after-a-match-in-a-line%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Here is a 2 pass awk solution:



    awk 'BEGIN{FS=OFS=":"}
    FNR == NR {
    r[FNR]=$1
    next
    }
    /^Probable Cause:/ {
    $1 = r[FNR+3]
    n=FNR
    }
    FNR == n+3 && /^Specific Event / {
    $1 = r[FNR-3]
    } 1' file file




    Serial : blah blah blah
    A-TYPE: blah blah blah
    O-type: blah blah blah
    instance: blah blah blah
    fault: blah blah blah
    sev: blah blah blah
    Specific Event MOC: Unspecified reason
    ack: blah blah blah
    time: blah blah blah
    Probable Cause: blah blah blah
    cause: blah blah blah
    Specific Problem: blah blah blah


    Explanation:





    • BEGIN block sets input and output field separators as :


    • FNR == NR: While processing file 1st time


    • r[FNR]=$1: Store first columns by key as their record no


    • next: Move to next record

    • Now awk will be processing file 2nd time


    • /^Probable Cause:/: When we find this text in a record


    • $1 = r[FNR+3]: Set 1st column as 1st column of 3rd record ahead from current


    • n=FNR: Store current record in variable n


    • FNR == n+3 && /^Specific Event /: When current record is n+3 and we get line starting with Specific Event


    • $1 = r[FNR-3]: Set 1st column as 1st column of 3rd previous record from current






    share|improve this answer


























    • but i guess there will be two string of Probable Cause.. will be displayed out which is not matching with my final output as shown in my question

      – Prayag
      Nov 26 '18 at 21:01











    • sorry I had a mistake, try updated code now

      – anubhava
      Nov 26 '18 at 21:05






    • 1





      thanks Anubhava for the support . and also thanks to all for helping me out.is is possible to explain what exactly it is done by awk which you provided and what is the changes if i need to swap after a string is matched, like if Unspecified reason is found do the swapping in that line.

      – Prayag
      Nov 26 '18 at 21:09













    • I have modified my awk to make it more efficient and added detailed explanation.

      – anubhava
      Nov 26 '18 at 21:18






    • 1





      u r genius!!! . such precise explanation.

      – Prayag
      Nov 26 '18 at 21:24
















    1














    Here is a 2 pass awk solution:



    awk 'BEGIN{FS=OFS=":"}
    FNR == NR {
    r[FNR]=$1
    next
    }
    /^Probable Cause:/ {
    $1 = r[FNR+3]
    n=FNR
    }
    FNR == n+3 && /^Specific Event / {
    $1 = r[FNR-3]
    } 1' file file




    Serial : blah blah blah
    A-TYPE: blah blah blah
    O-type: blah blah blah
    instance: blah blah blah
    fault: blah blah blah
    sev: blah blah blah
    Specific Event MOC: Unspecified reason
    ack: blah blah blah
    time: blah blah blah
    Probable Cause: blah blah blah
    cause: blah blah blah
    Specific Problem: blah blah blah


    Explanation:





    • BEGIN block sets input and output field separators as :


    • FNR == NR: While processing file 1st time


    • r[FNR]=$1: Store first columns by key as their record no


    • next: Move to next record

    • Now awk will be processing file 2nd time


    • /^Probable Cause:/: When we find this text in a record


    • $1 = r[FNR+3]: Set 1st column as 1st column of 3rd record ahead from current


    • n=FNR: Store current record in variable n


    • FNR == n+3 && /^Specific Event /: When current record is n+3 and we get line starting with Specific Event


    • $1 = r[FNR-3]: Set 1st column as 1st column of 3rd previous record from current






    share|improve this answer


























    • but i guess there will be two string of Probable Cause.. will be displayed out which is not matching with my final output as shown in my question

      – Prayag
      Nov 26 '18 at 21:01











    • sorry I had a mistake, try updated code now

      – anubhava
      Nov 26 '18 at 21:05






    • 1





      thanks Anubhava for the support . and also thanks to all for helping me out.is is possible to explain what exactly it is done by awk which you provided and what is the changes if i need to swap after a string is matched, like if Unspecified reason is found do the swapping in that line.

      – Prayag
      Nov 26 '18 at 21:09













    • I have modified my awk to make it more efficient and added detailed explanation.

      – anubhava
      Nov 26 '18 at 21:18






    • 1





      u r genius!!! . such precise explanation.

      – Prayag
      Nov 26 '18 at 21:24














    1












    1








    1







    Here is a 2 pass awk solution:



    awk 'BEGIN{FS=OFS=":"}
    FNR == NR {
    r[FNR]=$1
    next
    }
    /^Probable Cause:/ {
    $1 = r[FNR+3]
    n=FNR
    }
    FNR == n+3 && /^Specific Event / {
    $1 = r[FNR-3]
    } 1' file file




    Serial : blah blah blah
    A-TYPE: blah blah blah
    O-type: blah blah blah
    instance: blah blah blah
    fault: blah blah blah
    sev: blah blah blah
    Specific Event MOC: Unspecified reason
    ack: blah blah blah
    time: blah blah blah
    Probable Cause: blah blah blah
    cause: blah blah blah
    Specific Problem: blah blah blah


    Explanation:





    • BEGIN block sets input and output field separators as :


    • FNR == NR: While processing file 1st time


    • r[FNR]=$1: Store first columns by key as their record no


    • next: Move to next record

    • Now awk will be processing file 2nd time


    • /^Probable Cause:/: When we find this text in a record


    • $1 = r[FNR+3]: Set 1st column as 1st column of 3rd record ahead from current


    • n=FNR: Store current record in variable n


    • FNR == n+3 && /^Specific Event /: When current record is n+3 and we get line starting with Specific Event


    • $1 = r[FNR-3]: Set 1st column as 1st column of 3rd previous record from current






    share|improve this answer















    Here is a 2 pass awk solution:



    awk 'BEGIN{FS=OFS=":"}
    FNR == NR {
    r[FNR]=$1
    next
    }
    /^Probable Cause:/ {
    $1 = r[FNR+3]
    n=FNR
    }
    FNR == n+3 && /^Specific Event / {
    $1 = r[FNR-3]
    } 1' file file




    Serial : blah blah blah
    A-TYPE: blah blah blah
    O-type: blah blah blah
    instance: blah blah blah
    fault: blah blah blah
    sev: blah blah blah
    Specific Event MOC: Unspecified reason
    ack: blah blah blah
    time: blah blah blah
    Probable Cause: blah blah blah
    cause: blah blah blah
    Specific Problem: blah blah blah


    Explanation:





    • BEGIN block sets input and output field separators as :


    • FNR == NR: While processing file 1st time


    • r[FNR]=$1: Store first columns by key as their record no


    • next: Move to next record

    • Now awk will be processing file 2nd time


    • /^Probable Cause:/: When we find this text in a record


    • $1 = r[FNR+3]: Set 1st column as 1st column of 3rd record ahead from current


    • n=FNR: Store current record in variable n


    • FNR == n+3 && /^Specific Event /: When current record is n+3 and we get line starting with Specific Event


    • $1 = r[FNR-3]: Set 1st column as 1st column of 3rd previous record from current







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 26 '18 at 21:18

























    answered Nov 26 '18 at 20:58









    anubhavaanubhava

    535k48334412




    535k48334412













    • but i guess there will be two string of Probable Cause.. will be displayed out which is not matching with my final output as shown in my question

      – Prayag
      Nov 26 '18 at 21:01











    • sorry I had a mistake, try updated code now

      – anubhava
      Nov 26 '18 at 21:05






    • 1





      thanks Anubhava for the support . and also thanks to all for helping me out.is is possible to explain what exactly it is done by awk which you provided and what is the changes if i need to swap after a string is matched, like if Unspecified reason is found do the swapping in that line.

      – Prayag
      Nov 26 '18 at 21:09













    • I have modified my awk to make it more efficient and added detailed explanation.

      – anubhava
      Nov 26 '18 at 21:18






    • 1





      u r genius!!! . such precise explanation.

      – Prayag
      Nov 26 '18 at 21:24



















    • but i guess there will be two string of Probable Cause.. will be displayed out which is not matching with my final output as shown in my question

      – Prayag
      Nov 26 '18 at 21:01











    • sorry I had a mistake, try updated code now

      – anubhava
      Nov 26 '18 at 21:05






    • 1





      thanks Anubhava for the support . and also thanks to all for helping me out.is is possible to explain what exactly it is done by awk which you provided and what is the changes if i need to swap after a string is matched, like if Unspecified reason is found do the swapping in that line.

      – Prayag
      Nov 26 '18 at 21:09













    • I have modified my awk to make it more efficient and added detailed explanation.

      – anubhava
      Nov 26 '18 at 21:18






    • 1





      u r genius!!! . such precise explanation.

      – Prayag
      Nov 26 '18 at 21:24

















    but i guess there will be two string of Probable Cause.. will be displayed out which is not matching with my final output as shown in my question

    – Prayag
    Nov 26 '18 at 21:01





    but i guess there will be two string of Probable Cause.. will be displayed out which is not matching with my final output as shown in my question

    – Prayag
    Nov 26 '18 at 21:01













    sorry I had a mistake, try updated code now

    – anubhava
    Nov 26 '18 at 21:05





    sorry I had a mistake, try updated code now

    – anubhava
    Nov 26 '18 at 21:05




    1




    1





    thanks Anubhava for the support . and also thanks to all for helping me out.is is possible to explain what exactly it is done by awk which you provided and what is the changes if i need to swap after a string is matched, like if Unspecified reason is found do the swapping in that line.

    – Prayag
    Nov 26 '18 at 21:09







    thanks Anubhava for the support . and also thanks to all for helping me out.is is possible to explain what exactly it is done by awk which you provided and what is the changes if i need to swap after a string is matched, like if Unspecified reason is found do the swapping in that line.

    – Prayag
    Nov 26 '18 at 21:09















    I have modified my awk to make it more efficient and added detailed explanation.

    – anubhava
    Nov 26 '18 at 21:18





    I have modified my awk to make it more efficient and added detailed explanation.

    – anubhava
    Nov 26 '18 at 21:18




    1




    1





    u r genius!!! . such precise explanation.

    – Prayag
    Nov 26 '18 at 21:24





    u r genius!!! . such precise explanation.

    – Prayag
    Nov 26 '18 at 21:24













    1














    your data in 'd', by gnu sed;



    sed -E '/^Probable Cause:/{N;N;N;s/([^:]+)(:.+n.+n.+n)([^:]+):(.+)/321/}' d





    share|improve this answer




























      1














      your data in 'd', by gnu sed;



      sed -E '/^Probable Cause:/{N;N;N;s/([^:]+)(:.+n.+n.+n)([^:]+):(.+)/321/}' d





      share|improve this answer


























        1












        1








        1







        your data in 'd', by gnu sed;



        sed -E '/^Probable Cause:/{N;N;N;s/([^:]+)(:.+n.+n.+n)([^:]+):(.+)/321/}' d





        share|improve this answer













        your data in 'd', by gnu sed;



        sed -E '/^Probable Cause:/{N;N;N;s/([^:]+)(:.+n.+n.+n)([^:]+):(.+)/321/}' d






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 8 at 12:29









        abdanabdan

        416




        416






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53488562%2freplace-with-string-present-in-nth-line-after-a-match-in-a-line%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            To store a contact into the json file from server.js file using a class in NodeJS

            Redirect URL with Chrome Remote Debugging Android Devices

            Dieringhausen