Community
    • Login

    work on several lines?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 3 Posters 388 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.
    • Zen2coolZ
      Zen2cool
      last edited by Zen2cool

      Hello,

      I’m busy putting order in a txt file to prepare it for injection into a DB sql

      I have lines like this ( 40000) hence the efficiency of removing excess flow with notepad++

      the lines between =====+ and TOTAL EUROS are all different. I can have one as ten.

      +====================== Ticket 16392 =======================

      1 6X50G GO MY LITTLE ONE 2.89 2.89 2.89 B

      1 400G NEXP CAT STER STER 3.49 3.49 3.49 B

      TOTAL EUROS: 3.38

      Is it possible to collect just this with a regex?

      +====================== Ticket 16392 =======================

      TOTAL EUROS: 3.38

      Is it also possible to transform this (all my lines have different values)?

      B 21.00% 3.30 0.69 3.99

      to

      B 21.00%

      3.30

      0.69

      3.99

      I can’t afford to do any line by line

      Thank you.

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

        @Zen2cool

        For the first part, I’m confused about what you want to transform to, so I’ll skip it…

        For the second part, you could try matching with this:

        ^(B\s\d{1,2}\.\d+%)\s(\d+\.\d+)\s(\d+\.\d+)\s(\d+\.\d+)

        And replacing with this:

        \1\r\n\2\r\n\3\r\n\4\r\n

        Search mode must be set to Regular expression, of course…but you seem to know that already.

        Zen2coolZ 1 Reply Last reply Reply Quote 2
        • Zen2coolZ
          Zen2cool
          last edited by

          Thanks,

          for the first part I just want to get what’s between

          +====================== Ticket xxxx ======================= and TOTAL EUROS: xxxx

          II have (xxxx) 40,000 tickets. !

          I’ll try the rest tonight.

          Thanks

          Rudy

          1 Reply Last reply Reply Quote 0
          • Zen2coolZ
            Zen2cool
            last edited by

            I just want to keep what’s between

            +====================== Ticket 16392 =======================+
            TOTAL EUROS:

            and between these two lines I can have between 1 and 10 lines of text for example

            1 Reply Last reply Reply Quote 0
            • Zen2coolZ
              Zen2cool @Alan Kilborn
              last edited by

              @Alan-Kilborn

              Thank you again, for the second part

              regards,

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

                Hello, @zen2cool and All,

                If I understand you, correctly, you would like that, given the text :

                +====================== Ticket 16392 =======================
                
                1 6X50G GO MY LITTLE ONE 2.89 2.89 2.89 B
                
                1 400G NEXP CAT STER STER 3.49 3.49 3.49 B
                
                TOTAL EUROS: 3.38
                

                You expect the text :

                1 6X50G GO MY LITTLE ONE 2.89 2.89 2.89 B
                
                1 400G NEXP CAT STER STER 3.49 3.49 3.49 B
                

                Am I right about it ? If so, use this regex S/R :

                SEARCH (?-is)^.+Ticket.+\R\R|\RTOTAL EUROS.+\R

                REPLACE Leave Empty

                Best Reards,

                guy038

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