find IDs of databases with error during upgrade

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I have a log file of errors captured in my database, the file contains a list of the records that had errors and were not updated. The record names are 10 digits and start with a strA:



Error: could not save changes to record strA5903427123
Error: could not save changes to record strB4403298440
Error: could not save changes to record strC5903427342
Error: could not save changes to record strD4403298988
Error: could not save changes to record strE5903427298
Error: could not save changes to record strF4403298232
Error: could not save changes to record strG5903427455
Error: could not save changes to record strH4403298223


I want to extract the list of ten digits and A and remove "Error: could not save changes to record str", how can I do it in bash, this is a very long list and I have many files like this one everyone for the database.










share|improve this question









New contributor




Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    4
    down vote

    favorite












    I have a log file of errors captured in my database, the file contains a list of the records that had errors and were not updated. The record names are 10 digits and start with a strA:



    Error: could not save changes to record strA5903427123
    Error: could not save changes to record strB4403298440
    Error: could not save changes to record strC5903427342
    Error: could not save changes to record strD4403298988
    Error: could not save changes to record strE5903427298
    Error: could not save changes to record strF4403298232
    Error: could not save changes to record strG5903427455
    Error: could not save changes to record strH4403298223


    I want to extract the list of ten digits and A and remove "Error: could not save changes to record str", how can I do it in bash, this is a very long list and I have many files like this one everyone for the database.










    share|improve this question









    New contributor




    Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I have a log file of errors captured in my database, the file contains a list of the records that had errors and were not updated. The record names are 10 digits and start with a strA:



      Error: could not save changes to record strA5903427123
      Error: could not save changes to record strB4403298440
      Error: could not save changes to record strC5903427342
      Error: could not save changes to record strD4403298988
      Error: could not save changes to record strE5903427298
      Error: could not save changes to record strF4403298232
      Error: could not save changes to record strG5903427455
      Error: could not save changes to record strH4403298223


      I want to extract the list of ten digits and A and remove "Error: could not save changes to record str", how can I do it in bash, this is a very long list and I have many files like this one everyone for the database.










      share|improve this question









      New contributor




      Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have a log file of errors captured in my database, the file contains a list of the records that had errors and were not updated. The record names are 10 digits and start with a strA:



      Error: could not save changes to record strA5903427123
      Error: could not save changes to record strB4403298440
      Error: could not save changes to record strC5903427342
      Error: could not save changes to record strD4403298988
      Error: could not save changes to record strE5903427298
      Error: could not save changes to record strF4403298232
      Error: could not save changes to record strG5903427455
      Error: could not save changes to record strH4403298223


      I want to extract the list of ten digits and A and remove "Error: could not save changes to record str", how can I do it in bash, this is a very long list and I have many files like this one everyone for the database.







      text-processing logs






      share|improve this question









      New contributor




      Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 4 hours ago









      msp9011

      3,63543862




      3,63543862






      New contributor




      Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 5 hours ago









      Gabi

      232




      232




      New contributor




      Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Is this what you want?



          sed -e 's/^.*str//' test.in


          Hope this helps






          share|improve this answer




















          • @Gabi ... you need to edit the question. start with a strA is mentioned instead of start with a str
            – msp9011
            4 hours ago


















          up vote
          2
          down vote













          using grep to list the 10 digit ID that starts with A



          grep -Eo "A[0-9]10" file


          output



          A5903427123


          To list the 10 digit ID that starts with any uppercase alpha.



          grep -Eo "[A-Z][0-9]10" file

          A5903427123
          C5903427342
          D4403298988
          E5903427298
          F4403298232
          G5903427455
          H4403298223





          share|improve this answer





























            up vote
            2
            down vote













            You can do it in awk as follows:



            awk 'print $8' file | tr -d "str"

            A5903427123
            B4403298440
            C5903427342
            D4403298988
            E5903427298
            F4403298232
            G5903427455
            H4403298223





            share|improve this answer






















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "106"
              ;
              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: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              Gabi is a new contributor. Be nice, and check out our Code of Conduct.









               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474344%2ffind-ids-of-databases-with-error-during-upgrade%23new-answer', 'question_page');

              );

              Post as a guest






























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote



              accepted










              Is this what you want?



              sed -e 's/^.*str//' test.in


              Hope this helps






              share|improve this answer




















              • @Gabi ... you need to edit the question. start with a strA is mentioned instead of start with a str
                – msp9011
                4 hours ago















              up vote
              2
              down vote



              accepted










              Is this what you want?



              sed -e 's/^.*str//' test.in


              Hope this helps






              share|improve this answer




















              • @Gabi ... you need to edit the question. start with a strA is mentioned instead of start with a str
                – msp9011
                4 hours ago













              up vote
              2
              down vote



              accepted







              up vote
              2
              down vote



              accepted






              Is this what you want?



              sed -e 's/^.*str//' test.in


              Hope this helps






              share|improve this answer












              Is this what you want?



              sed -e 's/^.*str//' test.in


              Hope this helps







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered 5 hours ago









              Lewis M

              4493




              4493











              • @Gabi ... you need to edit the question. start with a strA is mentioned instead of start with a str
                – msp9011
                4 hours ago

















              • @Gabi ... you need to edit the question. start with a strA is mentioned instead of start with a str
                – msp9011
                4 hours ago
















              @Gabi ... you need to edit the question. start with a strA is mentioned instead of start with a str
              – msp9011
              4 hours ago





              @Gabi ... you need to edit the question. start with a strA is mentioned instead of start with a str
              – msp9011
              4 hours ago













              up vote
              2
              down vote













              using grep to list the 10 digit ID that starts with A



              grep -Eo "A[0-9]10" file


              output



              A5903427123


              To list the 10 digit ID that starts with any uppercase alpha.



              grep -Eo "[A-Z][0-9]10" file

              A5903427123
              C5903427342
              D4403298988
              E5903427298
              F4403298232
              G5903427455
              H4403298223





              share|improve this answer


























                up vote
                2
                down vote













                using grep to list the 10 digit ID that starts with A



                grep -Eo "A[0-9]10" file


                output



                A5903427123


                To list the 10 digit ID that starts with any uppercase alpha.



                grep -Eo "[A-Z][0-9]10" file

                A5903427123
                C5903427342
                D4403298988
                E5903427298
                F4403298232
                G5903427455
                H4403298223





                share|improve this answer
























                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  using grep to list the 10 digit ID that starts with A



                  grep -Eo "A[0-9]10" file


                  output



                  A5903427123


                  To list the 10 digit ID that starts with any uppercase alpha.



                  grep -Eo "[A-Z][0-9]10" file

                  A5903427123
                  C5903427342
                  D4403298988
                  E5903427298
                  F4403298232
                  G5903427455
                  H4403298223





                  share|improve this answer














                  using grep to list the 10 digit ID that starts with A



                  grep -Eo "A[0-9]10" file


                  output



                  A5903427123


                  To list the 10 digit ID that starts with any uppercase alpha.



                  grep -Eo "[A-Z][0-9]10" file

                  A5903427123
                  C5903427342
                  D4403298988
                  E5903427298
                  F4403298232
                  G5903427455
                  H4403298223






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 4 hours ago

























                  answered 5 hours ago









                  msp9011

                  3,63543862




                  3,63543862




















                      up vote
                      2
                      down vote













                      You can do it in awk as follows:



                      awk 'print $8' file | tr -d "str"

                      A5903427123
                      B4403298440
                      C5903427342
                      D4403298988
                      E5903427298
                      F4403298232
                      G5903427455
                      H4403298223





                      share|improve this answer


























                        up vote
                        2
                        down vote













                        You can do it in awk as follows:



                        awk 'print $8' file | tr -d "str"

                        A5903427123
                        B4403298440
                        C5903427342
                        D4403298988
                        E5903427298
                        F4403298232
                        G5903427455
                        H4403298223





                        share|improve this answer
























                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          You can do it in awk as follows:



                          awk 'print $8' file | tr -d "str"

                          A5903427123
                          B4403298440
                          C5903427342
                          D4403298988
                          E5903427298
                          F4403298232
                          G5903427455
                          H4403298223





                          share|improve this answer














                          You can do it in awk as follows:



                          awk 'print $8' file | tr -d "str"

                          A5903427123
                          B4403298440
                          C5903427342
                          D4403298988
                          E5903427298
                          F4403298232
                          G5903427455
                          H4403298223






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 4 hours ago

























                          answered 5 hours ago









                          Goro

                          8,14153878




                          8,14153878




















                              Gabi is a new contributor. Be nice, and check out our Code of Conduct.









                               

                              draft saved


                              draft discarded


















                              Gabi is a new contributor. Be nice, and check out our Code of Conduct.












                              Gabi is a new contributor. Be nice, and check out our Code of Conduct.











                              Gabi is a new contributor. Be nice, and check out our Code of Conduct.













                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474344%2ffind-ids-of-databases-with-error-during-upgrade%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              Installing NextGIS Connect into QGIS 3?

                              One-line joke