Community
    • Login

    reg-ex to clean txt file

    Scheduled Pinned Locked Moved General Discussion
    14 Posts 5 Posters 639 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.
    • Terry RT
      Terry R @cisco779k
      last edited by

      @cisco779k
      Why not convert all spaces to newlines. Then bookmark all lines with http. Then remove all non bookmarked lines.

      Terry

      1 Reply Last reply Reply Quote 3
      • Alan KilbornA
        Alan Kilborn
        last edited by

        @cisco779k

        After Terry’s suggestion, you may want to execute this replacement operation:

        Find: (?-is)^.+?(?=https:)
        Replace: nothing
        Search mode: Regular expression

        to remove what occurs before https on your lines.

        1 Reply Last reply Reply Quote 0
        • cisco779kC
          cisco779k
          last edited by cisco779k

          @ Terry
          thanks for your reply, but not easy for me follow your suggestion. you can provide and example?
          or you talk about Edit - Line operations - Remove empty Lines ?

          @ Alan
          thanks also for your reply. your regex can work. i need only to understand the first step …

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

            @cisco779k

            Oops. Terry’s suggestion will work, without my add-on.

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

              @cisco779k

              Terry’s solution involves:

              Find: \x20
              Replace: \r\n
              Search mode: Regular expression

              Then, Search menu > Mark with Find: https.

              Then Search menu > Bookmark > Remove Non-Bookmarked Lines.

              Mark OlsonM 1 Reply Last reply Reply Quote 2
              • Mark OlsonM
                Mark Olson @Alan Kilborn
                last edited by

                @Alan-Kilborn
                Just an addendum to this solution: it won’t work unless you check Bookmark line on the Mark menu, because that is not checked by default.

                Alan KilbornA 1 Reply Last reply Reply Quote 2
                • Alan KilbornA
                  Alan Kilborn @Mark Olson
                  last edited by

                  @Mark-Olson said in reg-ex to clean txt file:

                  Just an addendum to this solution: it won’t work unless you check Bookmark line on the Mark menu

                  Yep, for sure, meant to mention that…I just didn’t. :-)
                  Thanks for picking me up.

                  1 Reply Last reply Reply Quote 0
                  • cisco779kC
                    cisco779k
                    last edited by

                    oh yes Alan, your tip work like a charm
                    and thanks also to Mark Olson for your clarification

                    1 Reply Last reply Reply Quote 0
                    • cisco779kC
                      cisco779k
                      last edited by cisco779k

                      i’ve saved all steps to new macro, and this work fine.
                      also i’ve noticed that the macro is saved on shortcuts.xml file.
                      I wonder if you can save the macro to a separate file … (to not to forget it in the future)

                      Terry RT 1 Reply Last reply Reply Quote 0
                      • Terry RT
                        Terry R @cisco779k
                        last edited by Terry R

                        @cisco779k

                        Firstly, you have been a member of this forum since August 2017, so at least 5 years. You have asked a number of regex related questions and received answers in all cases.

                        You have been requested to start learning regex, see here, that was over 2 years ago, yet you still don’t appear to have learnt even the basics.

                        I supplied my solution last night via a smartphone, hence the shortness of the post. But I at least expected you to understand how to use that to solve your question.

                        I must say you appear to have been lucky in getting so many solutions. Normally we request users in your position to have at least tried to figure out an answer. Then present us with what you tried.

                        How about trying to learn now!

                        Terry

                        1 Reply Last reply Reply Quote 5
                        • cisco779kC
                          cisco779k
                          last edited by cisco779k

                          … useless polemic …

                          on my first post, i’ve ask help for a regex to my trouble. very hard for me.

                          maybe i would have at this solution on my own
                          (but thanks anyway to Alan for your support)

                          Alan KilbornA Lycan ThropeL 2 Replies Last reply Reply Quote -1
                          • Alan KilbornA
                            Alan Kilborn @cisco779k
                            last edited by

                            @cisco779k said in reg-ex to clean txt file:

                            but thanks anyway to Alan for your support

                            You’re welcome but I agree with Terry.
                            You need to start learning how to do such things.
                            For some reason I didn’t check your posting history before contributing thoughts to this thread.

                            1 Reply Last reply Reply Quote 2
                            • Lycan ThropeL
                              Lycan Thrope @cisco779k
                              last edited by Lycan Thrope

                              @cisco779k ,
                              You seem to have quite a vocabulary for a non-english speaker, so try using your intelligence for learning regex, rather than crying for help and using $20.00 word swipes at the volunteers, who I wouldn’t blame for letting your posts die from neglect from here on out. And yes, polemic fits this post just fine.

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