• Login
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.
  • A
    Altevir Gomes @Thomas Knoefel
    last edited by Altevir Gomes Nov 15, 2023, 10:37 AM Nov 15, 2023, 10:36 AM

    @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

    A 1 Reply Last reply Nov 15, 2023, 2:30 PM Reply Quote 0
    • G
      guy038
      last edited by guy038 Nov 15, 2023, 1:36 PM Nov 15, 2023, 12:25 PM

      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

      A 2 Replies Last reply Nov 15, 2023, 7:35 PM Reply Quote 2
      • P
        PeterJones @Altevir Gomes
        last edited by PeterJones Nov 15, 2023, 2:11 PM Nov 15, 2023, 2:10 PM

        @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
        • A
          Alan Kilborn @Altevir Gomes
          last edited by Nov 15, 2023, 2:30 PM

          @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
          • A
            Altevir Gomes @guy038
            last edited by Nov 15, 2023, 7:35 PM

            @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
            • A
              Altevir Gomes @guy038
              last edited by Nov 18, 2023, 12:00 PM

              @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

              A 1 Reply Last reply Nov 18, 2023, 12:51 PM Reply Quote 0
              • A
                Alan Kilborn @Altevir Gomes
                last edited by Nov 18, 2023, 12:51 PM

                @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
                • G
                  guy038
                  last edited by guy038 Nov 18, 2023, 5:40 PM Nov 18, 2023, 5:29 PM

                  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

                  A 1 Reply Last reply Nov 20, 2023, 10:06 PM Reply Quote 1
                  • A
                    Altevir Gomes @guy038
                    last edited by Nov 20, 2023, 10:06 PM

                    @guy038 not work to me, but thx.

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

                    N 1 Reply Last reply Nov 24, 2023, 12:56 PM Reply Quote 0
                    • N
                      NippurDeLagash @Altevir Gomes
                      last edited by Nov 24, 2023, 12:56 PM

                      @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
                      17 out of 17
                      • First post
                        17/17
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors