Community
    • Login

    erase exacly lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    17 Posts 7 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Altevir GomesA
      Altevir Gomes @Thomas Knoefel
      last edited by Altevir Gomes

      @Thomas-Knoefel i have another question

      EXAMPLE:

      LIVE | 07934954409|carol123 - EMAIL: ericaveras@bol.com.br - #MaxCenter
      LIVE | 31083380800|pizetta1 - EMAIL: isaias.pizetta@bol.com.br - #MaxCenter
      LIVE | 45925437500|gel0473 - EMAIL: rogerdolar@bol.com.br - #MaxCenter
      LIVE | 95304185072|saimon18 - EMAIL: dilcelene@bol.com.br - #MaxCenter
      LIVE | 11578698820|r200700 - EMAIL: darsie@bol.com.br - #MaxCenter
      LIVE | 04543429699|180808re - EMAIL: xavierprojetos@bol.com.br - #MaxCent

      I WANT ONLY:

      04543429699|180808re
      11578698820|r200700
      95304185072|saimon18
      95304185072|saimon18
      45925437500|gel0473

      ID = have a default 11 numbers
      PASS = random pass’s

      ID/PASS

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • guy038G
        guy038
        last edited by guy038

        Hi, @altevir-gomes, @terry-r, @thomas-knoefel and All,

        I suppose that this regex S/R :

        SEARCH (?-is).+(?<=\|\x20)(.+)(?=\x20-\x20EMAIL:).+

        REPLACE \1

        Should work, as you expect to !

        BR

        guy038

        Altevir GomesA 2 Replies Last reply Reply Quote 2
        • PeterJonesP
          PeterJones @Altevir Gomes
          last edited by PeterJones

          @Altevir-Gomes said in erase exacly lines:

          it worked thank you, please close the post

          This forum doesn’t “close posts” or “mark posts as solved”. It’s for discussion, so people can keep replying with new ideas or tangential thoughts even after your original request has been solved.

          —

          Also, since no one has mentioned any of the following yet:

          Useful References

          • Please Read Before Posting
          • Template for Search/Replace Questions
          • Formatting Forum Posts
          • Notepad++ Online User Manual: Searching/Regex
          • FAQ: Where to find other regular expressions (regex) documentation
          1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Altevir Gomes
            last edited by

            @Altevir-Gomes :

            And before you say this yet again:

            i have another question

            Please try and study what you’ve already been given along with the references provided, and try to solve your own problems of this sort. Sure, if you have trouble, post back here, but be prepared to show you have at least made an effort first.

            1 Reply Last reply Reply Quote 1
            • Altevir GomesA
              Altevir Gomes @guy038
              last edited by

              @guy038 WORKED TOO, you are a genius, thx <3

              i’m from brazil sorry for my bad english

              1 Reply Last reply Reply Quote 2
              • Altevir GomesA
                Altevir Gomes @guy038
                last edited by

                @guy038 hey guy, please can help me again? i have other question

                THIS:

                Registro : 13
                Itau S/A - Gold
                Cartão : 5484740469100643
                Validade : 04/2027
                Cod. Segurança : 676
                SENHA DO CARTÃO : 2572
                Portador : Valdir Nogueira da Silva
                CPF : 219.729.403-25
                e-mail : valdirbm2013@yahoo.com
                senha : bombeiro
                endereço : Rua 60
                número : 342
                bairro : Jereissati II
                cidade : Maracanaú
                estado : CE
                cep : 61901-240
                data : 06/06/2020 10:03

                I WANT ONLY THIS

                5484740469100643|04|2027|676

                Alan KilbornA 1 Reply Last reply Reply Quote 0
                • Alan KilbornA
                  Alan Kilborn @Altevir Gomes
                  last edited by

                  @Altevir-Gomes said in erase exacly lines:

                  please can help me again?

                  What have you tried on your own first?
                  This isn’t a data transformation service where you just get free, no effort (expended by you) help, over and over again.

                  1 Reply Last reply Reply Quote 0
                  • guy038G
                    guy038
                    last edited by guy038

                    Hi, @altevir-gomes, @terry-r, @thomas-knoefel, @alan-kilborn and All,

                    For the last time, I’m going to give you the right regex S/R to use. But, frankly, you would better off spending some spare time to learn the basic regex features !

                    Refer to the link below for further information :

                    https://community.notepad-plus-plus.org/topic/15765/faq-where-to-find-regular-expressions-regex-documentation/1


                    So, starting from your INPUT text :

                    Registro : 13
                    Itau S/A - Gold
                    Cartão : 5484740469100643
                    Validade : 04/2027
                    Cod. Segurança : 676
                    SENHA DO CARTÃO : 2572
                    Portador : Valdir Nogueira da Silva
                    CPF : 219.729.403-25
                    e-mail : valdirbm2013@yahoo.com
                    senha : bombeiro
                    endereço : Rua 60
                    número : 342
                    bairro : Jereissati II
                    cidade : Maracanaú
                    estado : CE
                    cep : 61901-240
                    data : 06/06/2020 10:03
                    
                    

                    If you use the following regex S/R :

                    SEARCH (?-si)^Registro(?s:.+?)Cartão : (.+)\RValidade : (.+)/(.+)\RCod. Segurança : (.+)(?s:.+?)^data.+(\R\R)

                    REPLACE \1|\2|\3|\4\5

                    You should get your expected OUTPUT text :

                    5484740469100643|04|2027|676
                    
                    

                    Note that I suppose that each block of text is always separated with a line-break !


                    Now, some quick hints about the search and replace regexes. I’ll use the free-spacing mode for better visibility

                    
                    SEARCH
                    
                    (?x-si) ^ Registro       (?s: .+? )  Cartão [ ]:[ ] (.+) \R   Validade [ ]:[ ] (.+) / (.+) \R  Cod \.[ ] Segurança[ ]:[ ] (.+) \R  (?s: .+? ) ^ data .+? ( \R\R )
                              <---FIRST TWO lines ---->  <---- THIRD line ---->   <-------- FOURTH line -------->  <---------- FIFTH line ---------->  < OTHERS >   <-- LAST line -->
                    
                    
                    REPLACE
                    
                    \1|\2|\3|\4\5
                    
                    \1 represents the 'Card' number AFTER the 'Cartão' string
                    
                    \2 and \3 represent the 'Month' and the 'Year' numbers AFTER the 'Validade' string
                    
                    \4 represent the 'Security' number AFTER the 'Cod. Segurança' string
                    
                    \5 represents the TWO line-breaks at the END ( the one after the LAST line and the EMPTY NEXT one )
                    
                    

                    Best Regards,

                    guy038

                    Altevir GomesA 1 Reply Last reply Reply Quote 1
                    • Altevir GomesA
                      Altevir Gomes @guy038
                      last edited by

                      @guy038 not work to me, but thx.

                      its very hard to learn REGEX i don’t speak english.

                      NippurDeLagashN 1 Reply Last reply Reply Quote 0
                      • NippurDeLagashN
                        NippurDeLagash @Altevir Gomes
                        last edited by

                        @Altevir-Gomes If you feel your English in not good enough, you can still learn Expressões Regulares (Em Portuguese do Brasil)" studying the following book:

                        https://www.piazinho.com.br/#download

                        The book dedicates a few pages to Notepad++ in chapter 6.

                        1 Reply Last reply Reply Quote 4
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors