How to Delete lines that contain more than three dots in a email before @ character using SED?












0















sed '/(.*..*){4,}/d'


The above command mentioned recognizes every DOT in the line...



It is recognizing DOTS after @ sign too.
For example, even this is shown in the result: ryisan@Sariyer.Cc.itu.Edu.tr



Can you help me modify the above command in such a way that only the LEFT side of @ it counts the Multiple DOTS more than 3 and ignores the DOTS after the character @ to right side of the email?



Eg:



fgtc21_pk@yahoo.com
bhchemitex@chemitex.com
hjcindysun48@hotmail.com
hhconsult_sa.jan.2020@yahoo.com
s.ing.song.lan.g.ju.n.55.l@gmail.com
VB.t.o.t.all.y.f.it.s.19.99@yahoo.com
a.lice.i.n.wonde.r.lnd.2.1.f@dkg.com
ryisan@Sariyer.Cc.itu.Edu.tr


I want the following lines with multiple Dots (3 or more dots) at the LEFT SIDE of @ Character to be only recognizers and deleted from the file.



s.ing.song.lan.g.ju.n.55.l@gmail.com
VB.t.o.t.all.y.f.it.s.19.99@yahoo.com
a.lice.i.n.wonde.r.lnd.2.1.f@dkg.com


Any experts, plz suggest me how to modify the above SED command.... Thanks










share|improve this question



























    0















    sed '/(.*..*){4,}/d'


    The above command mentioned recognizes every DOT in the line...



    It is recognizing DOTS after @ sign too.
    For example, even this is shown in the result: ryisan@Sariyer.Cc.itu.Edu.tr



    Can you help me modify the above command in such a way that only the LEFT side of @ it counts the Multiple DOTS more than 3 and ignores the DOTS after the character @ to right side of the email?



    Eg:



    fgtc21_pk@yahoo.com
    bhchemitex@chemitex.com
    hjcindysun48@hotmail.com
    hhconsult_sa.jan.2020@yahoo.com
    s.ing.song.lan.g.ju.n.55.l@gmail.com
    VB.t.o.t.all.y.f.it.s.19.99@yahoo.com
    a.lice.i.n.wonde.r.lnd.2.1.f@dkg.com
    ryisan@Sariyer.Cc.itu.Edu.tr


    I want the following lines with multiple Dots (3 or more dots) at the LEFT SIDE of @ Character to be only recognizers and deleted from the file.



    s.ing.song.lan.g.ju.n.55.l@gmail.com
    VB.t.o.t.all.y.f.it.s.19.99@yahoo.com
    a.lice.i.n.wonde.r.lnd.2.1.f@dkg.com


    Any experts, plz suggest me how to modify the above SED command.... Thanks










    share|improve this question

























      0












      0








      0








      sed '/(.*..*){4,}/d'


      The above command mentioned recognizes every DOT in the line...



      It is recognizing DOTS after @ sign too.
      For example, even this is shown in the result: ryisan@Sariyer.Cc.itu.Edu.tr



      Can you help me modify the above command in such a way that only the LEFT side of @ it counts the Multiple DOTS more than 3 and ignores the DOTS after the character @ to right side of the email?



      Eg:



      fgtc21_pk@yahoo.com
      bhchemitex@chemitex.com
      hjcindysun48@hotmail.com
      hhconsult_sa.jan.2020@yahoo.com
      s.ing.song.lan.g.ju.n.55.l@gmail.com
      VB.t.o.t.all.y.f.it.s.19.99@yahoo.com
      a.lice.i.n.wonde.r.lnd.2.1.f@dkg.com
      ryisan@Sariyer.Cc.itu.Edu.tr


      I want the following lines with multiple Dots (3 or more dots) at the LEFT SIDE of @ Character to be only recognizers and deleted from the file.



      s.ing.song.lan.g.ju.n.55.l@gmail.com
      VB.t.o.t.all.y.f.it.s.19.99@yahoo.com
      a.lice.i.n.wonde.r.lnd.2.1.f@dkg.com


      Any experts, plz suggest me how to modify the above SED command.... Thanks










      share|improve this question














      sed '/(.*..*){4,}/d'


      The above command mentioned recognizes every DOT in the line...



      It is recognizing DOTS after @ sign too.
      For example, even this is shown in the result: ryisan@Sariyer.Cc.itu.Edu.tr



      Can you help me modify the above command in such a way that only the LEFT side of @ it counts the Multiple DOTS more than 3 and ignores the DOTS after the character @ to right side of the email?



      Eg:



      fgtc21_pk@yahoo.com
      bhchemitex@chemitex.com
      hjcindysun48@hotmail.com
      hhconsult_sa.jan.2020@yahoo.com
      s.ing.song.lan.g.ju.n.55.l@gmail.com
      VB.t.o.t.all.y.f.it.s.19.99@yahoo.com
      a.lice.i.n.wonde.r.lnd.2.1.f@dkg.com
      ryisan@Sariyer.Cc.itu.Edu.tr


      I want the following lines with multiple Dots (3 or more dots) at the LEFT SIDE of @ Character to be only recognizers and deleted from the file.



      s.ing.song.lan.g.ju.n.55.l@gmail.com
      VB.t.o.t.all.y.f.it.s.19.99@yahoo.com
      a.lice.i.n.wonde.r.lnd.2.1.f@dkg.com


      Any experts, plz suggest me how to modify the above SED command.... Thanks







      linux command-line sed






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 23 at 5:53









      Joney WalkerJoney Walker

      235




      235






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I'm not an expert but, to delete only the 4 dots (or more) patterns at the left side of @ you can simply add @.* at the end of your expression:



          sed '/(.*..*){4,}@.*/d'


          It means to delete the 4 dots (or more) patterns at the left side of the @ regardless what characters are at the right side.






          share|improve this answer
























          • Perfect... Thank you. That did that trick..

            – Joney Walker
            Jan 23 at 6:38











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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%2fsuperuser.com%2fquestions%2f1397293%2fhow-to-delete-lines-that-contain-more-than-three-dots-in-a-email-before-charac%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I'm not an expert but, to delete only the 4 dots (or more) patterns at the left side of @ you can simply add @.* at the end of your expression:



          sed '/(.*..*){4,}@.*/d'


          It means to delete the 4 dots (or more) patterns at the left side of the @ regardless what characters are at the right side.






          share|improve this answer
























          • Perfect... Thank you. That did that trick..

            – Joney Walker
            Jan 23 at 6:38
















          0














          I'm not an expert but, to delete only the 4 dots (or more) patterns at the left side of @ you can simply add @.* at the end of your expression:



          sed '/(.*..*){4,}@.*/d'


          It means to delete the 4 dots (or more) patterns at the left side of the @ regardless what characters are at the right side.






          share|improve this answer
























          • Perfect... Thank you. That did that trick..

            – Joney Walker
            Jan 23 at 6:38














          0












          0








          0







          I'm not an expert but, to delete only the 4 dots (or more) patterns at the left side of @ you can simply add @.* at the end of your expression:



          sed '/(.*..*){4,}@.*/d'


          It means to delete the 4 dots (or more) patterns at the left side of the @ regardless what characters are at the right side.






          share|improve this answer













          I'm not an expert but, to delete only the 4 dots (or more) patterns at the left side of @ you can simply add @.* at the end of your expression:



          sed '/(.*..*){4,}@.*/d'


          It means to delete the 4 dots (or more) patterns at the left side of the @ regardless what characters are at the right side.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 23 at 6:23









          YoricYoric

          3196




          3196













          • Perfect... Thank you. That did that trick..

            – Joney Walker
            Jan 23 at 6:38



















          • Perfect... Thank you. That did that trick..

            – Joney Walker
            Jan 23 at 6:38

















          Perfect... Thank you. That did that trick..

          – Joney Walker
          Jan 23 at 6:38





          Perfect... Thank you. That did that trick..

          – Joney Walker
          Jan 23 at 6:38


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • 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%2fsuperuser.com%2fquestions%2f1397293%2fhow-to-delete-lines-that-contain-more-than-three-dots-in-a-email-before-charac%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

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          RAC Tourist Trophy