Bash command to find string to the right of a decimal in between two parenthesis











up vote
0
down vote

favorite












Here is a piece of code...



out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
begin

out0.hram_cust_acct_actn_in::depends_on(
in.acct_ref_nb,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
/* Rule: "Compute hram_cust_acct_actn_in" */ );


out0.cld_acct_rndm_dgt_2_nb::depends_on(
in.entp_prty_id,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
);

out0.*::in.*;
end;


What this code is saying is that a data element is dependent on these other data elements. I want to run a series of sed command to strip all of the dependencies. I don't care what there dependents for. I just want all the dependencies listed. I then can use awk to remove duplicates. So for the above code it would print out....



acct_ref_nb
common_rollup_out_num00
entp_prty_id
common_rollup_out_num01


It's almost like I want to, for all text in between each set of parenthesis, print out string value to the right of a decimal point.










share|improve this question


















  • 1




    Can you confirm that dependencies are every single word (in the regex meaning, i.e. a sequence of letters, digits and underscores) that directly follow a dot ? I also see you have strings in this code, any chance they might contain dots?
    – Aaron
    Nov 20 at 16:36












  • Is this Abinitio code?.
    – stack0114106
    Nov 20 at 19:17















up vote
0
down vote

favorite












Here is a piece of code...



out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
begin

out0.hram_cust_acct_actn_in::depends_on(
in.acct_ref_nb,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
/* Rule: "Compute hram_cust_acct_actn_in" */ );


out0.cld_acct_rndm_dgt_2_nb::depends_on(
in.entp_prty_id,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
);

out0.*::in.*;
end;


What this code is saying is that a data element is dependent on these other data elements. I want to run a series of sed command to strip all of the dependencies. I don't care what there dependents for. I just want all the dependencies listed. I then can use awk to remove duplicates. So for the above code it would print out....



acct_ref_nb
common_rollup_out_num00
entp_prty_id
common_rollup_out_num01


It's almost like I want to, for all text in between each set of parenthesis, print out string value to the right of a decimal point.










share|improve this question


















  • 1




    Can you confirm that dependencies are every single word (in the regex meaning, i.e. a sequence of letters, digits and underscores) that directly follow a dot ? I also see you have strings in this code, any chance they might contain dots?
    – Aaron
    Nov 20 at 16:36












  • Is this Abinitio code?.
    – stack0114106
    Nov 20 at 19:17













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Here is a piece of code...



out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
begin

out0.hram_cust_acct_actn_in::depends_on(
in.acct_ref_nb,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
/* Rule: "Compute hram_cust_acct_actn_in" */ );


out0.cld_acct_rndm_dgt_2_nb::depends_on(
in.entp_prty_id,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
);

out0.*::in.*;
end;


What this code is saying is that a data element is dependent on these other data elements. I want to run a series of sed command to strip all of the dependencies. I don't care what there dependents for. I just want all the dependencies listed. I then can use awk to remove duplicates. So for the above code it would print out....



acct_ref_nb
common_rollup_out_num00
entp_prty_id
common_rollup_out_num01


It's almost like I want to, for all text in between each set of parenthesis, print out string value to the right of a decimal point.










share|improve this question













Here is a piece of code...



out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
begin

out0.hram_cust_acct_actn_in::depends_on(
in.acct_ref_nb,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
/* Rule: "Compute hram_cust_acct_actn_in" */ );


out0.cld_acct_rndm_dgt_2_nb::depends_on(
in.entp_prty_id,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
);

out0.*::in.*;
end;


What this code is saying is that a data element is dependent on these other data elements. I want to run a series of sed command to strip all of the dependencies. I don't care what there dependents for. I just want all the dependencies listed. I then can use awk to remove duplicates. So for the above code it would print out....



acct_ref_nb
common_rollup_out_num00
entp_prty_id
common_rollup_out_num01


It's almost like I want to, for all text in between each set of parenthesis, print out string value to the right of a decimal point.







bash unix sed






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 at 14:34









Brian Gurka

43




43








  • 1




    Can you confirm that dependencies are every single word (in the regex meaning, i.e. a sequence of letters, digits and underscores) that directly follow a dot ? I also see you have strings in this code, any chance they might contain dots?
    – Aaron
    Nov 20 at 16:36












  • Is this Abinitio code?.
    – stack0114106
    Nov 20 at 19:17














  • 1




    Can you confirm that dependencies are every single word (in the regex meaning, i.e. a sequence of letters, digits and underscores) that directly follow a dot ? I also see you have strings in this code, any chance they might contain dots?
    – Aaron
    Nov 20 at 16:36












  • Is this Abinitio code?.
    – stack0114106
    Nov 20 at 19:17








1




1




Can you confirm that dependencies are every single word (in the regex meaning, i.e. a sequence of letters, digits and underscores) that directly follow a dot ? I also see you have strings in this code, any chance they might contain dots?
– Aaron
Nov 20 at 16:36






Can you confirm that dependencies are every single word (in the regex meaning, i.e. a sequence of letters, digits and underscores) that directly follow a dot ? I also see you have strings in this code, any chance they might contain dots?
– Aaron
Nov 20 at 16:36














Is this Abinitio code?.
– stack0114106
Nov 20 at 19:17




Is this Abinitio code?.
– stack0114106
Nov 20 at 19:17












2 Answers
2






active

oldest

votes

















up vote
0
down vote













This is somewhat complex. I tried my best, please check if it does what you want.



$ cat ab_code.dat
out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
begin

out0.hram_cust_acct_actn_in::depends_on(
in.acct_ref_nb,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
/* Rule: "Compute hram_cust_acct_actn_in" */ );


out0.cld_acct_rndm_dgt_2_nb::depends_on(
in.entp_prty_id,
lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
);

out0.*::in.*;
end;

$ perl -0777 -ne ' { s/(.*)begin(.*?)end;/2/msg; while(/(?=::)(.*?)(.*?.(.+?)b.*?.(.+?));/msg) { print "$2n"."$3n" } } ' ab_code.dat | grep -v '/*'
acct_ref_nb
common_rollup_out_num00
entp_prty_id
common_rollup_out_num01





share|improve this answer




























    up vote
    -1
    down vote













    get your result with awk like so!



    awk -F ' . ' ' /,/ { print $2 } ' file






    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',
      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%2f53395325%2fbash-command-to-find-string-to-the-right-of-a-decimal-in-between-two-parenthesis%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








      up vote
      0
      down vote













      This is somewhat complex. I tried my best, please check if it does what you want.



      $ cat ab_code.dat
      out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
      begin

      out0.hram_cust_acct_actn_in::depends_on(
      in.acct_ref_nb,
      lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
      /* Rule: "Compute hram_cust_acct_actn_in" */ );


      out0.cld_acct_rndm_dgt_2_nb::depends_on(
      in.entp_prty_id,
      lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
      );

      out0.*::in.*;
      end;

      $ perl -0777 -ne ' { s/(.*)begin(.*?)end;/2/msg; while(/(?=::)(.*?)(.*?.(.+?)b.*?.(.+?));/msg) { print "$2n"."$3n" } } ' ab_code.dat | grep -v '/*'
      acct_ref_nb
      common_rollup_out_num00
      entp_prty_id
      common_rollup_out_num01





      share|improve this answer

























        up vote
        0
        down vote













        This is somewhat complex. I tried my best, please check if it does what you want.



        $ cat ab_code.dat
        out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
        begin

        out0.hram_cust_acct_actn_in::depends_on(
        in.acct_ref_nb,
        lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
        /* Rule: "Compute hram_cust_acct_actn_in" */ );


        out0.cld_acct_rndm_dgt_2_nb::depends_on(
        in.entp_prty_id,
        lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
        );

        out0.*::in.*;
        end;

        $ perl -0777 -ne ' { s/(.*)begin(.*?)end;/2/msg; while(/(?=::)(.*?)(.*?.(.+?)b.*?.(.+?));/msg) { print "$2n"."$3n" } } ' ab_code.dat | grep -v '/*'
        acct_ref_nb
        common_rollup_out_num00
        entp_prty_id
        common_rollup_out_num01





        share|improve this answer























          up vote
          0
          down vote










          up vote
          0
          down vote









          This is somewhat complex. I tried my best, please check if it does what you want.



          $ cat ab_code.dat
          out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
          begin

          out0.hram_cust_acct_actn_in::depends_on(
          in.acct_ref_nb,
          lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
          /* Rule: "Compute hram_cust_acct_actn_in" */ );


          out0.cld_acct_rndm_dgt_2_nb::depends_on(
          in.entp_prty_id,
          lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
          );

          out0.*::in.*;
          end;

          $ perl -0777 -ne ' { s/(.*)begin(.*?)end;/2/msg; while(/(?=::)(.*?)(.*?.(.+?)b.*?.(.+?));/msg) { print "$2n"."$3n" } } ' ab_code.dat | grep -v '/*'
          acct_ref_nb
          common_rollup_out_num00
          entp_prty_id
          common_rollup_out_num01





          share|improve this answer












          This is somewhat complex. I tried my best, please check if it does what you want.



          $ cat ab_code.dat
          out0::HRSKACTMGT_FNL_ACTN_DECSN_documentation(in)=
          begin

          out0.hram_cust_acct_actn_in::depends_on(
          in.acct_ref_nb,
          lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num00
          /* Rule: "Compute hram_cust_acct_actn_in" */ );


          out0.cld_acct_rndm_dgt_2_nb::depends_on(
          in.entp_prty_id,
          lookup("hrskactmgt interim actn decsn rollup lookup",'keystr').common_rollup_out_num01
          );

          out0.*::in.*;
          end;

          $ perl -0777 -ne ' { s/(.*)begin(.*?)end;/2/msg; while(/(?=::)(.*?)(.*?.(.+?)b.*?.(.+?));/msg) { print "$2n"."$3n" } } ' ab_code.dat | grep -v '/*'
          acct_ref_nb
          common_rollup_out_num00
          entp_prty_id
          common_rollup_out_num01






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 at 19:51









          stack0114106

          1,9251416




          1,9251416
























              up vote
              -1
              down vote













              get your result with awk like so!



              awk -F ' . ' ' /,/ { print $2 } ' file






              share|improve this answer



























                up vote
                -1
                down vote













                get your result with awk like so!



                awk -F ' . ' ' /,/ { print $2 } ' file






                share|improve this answer

























                  up vote
                  -1
                  down vote










                  up vote
                  -1
                  down vote









                  get your result with awk like so!



                  awk -F ' . ' ' /,/ { print $2 } ' file






                  share|improve this answer














                  get your result with awk like so!



                  awk -F ' . ' ' /,/ { print $2 } ' file







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 20 at 17:39









                  pushkin

                  3,859102551




                  3,859102551










                  answered Nov 20 at 15:42









                  noob

                  92




                  92






























                      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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2f53395325%2fbash-command-to-find-string-to-the-right-of-a-decimal-in-between-two-parenthesis%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

                      404 Error Contact Form 7 ajax form submitting

                      How to know if a Active Directory user can login interactively

                      TypeError: fit_transform() missing 1 required positional argument: 'X'