• Login
Community
  • Login

reg-ex to clean txt file

Scheduled Pinned Locked Moved General Discussion
14 Posts 5 Posters 666 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
    Alan Kilborn
    last edited by Mar 7, 2023, 12:47 PM

    @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
    • C
      cisco779k
      last edited by cisco779k Mar 7, 2023, 1:42 PM Mar 7, 2023, 1:40 PM

      @ 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 …

      A 1 Reply Last reply Mar 7, 2023, 2:01 PM Reply Quote 0
      • A
        Alan Kilborn @cisco779k
        last edited by Mar 7, 2023, 2:01 PM

        @cisco779k

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

        1 Reply Last reply Reply Quote 0
        • A
          Alan Kilborn
          last edited by Mar 7, 2023, 2:06 PM

          @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.

          M 1 Reply Last reply Mar 7, 2023, 2:35 PM Reply Quote 2
          • M
            Mark Olson @Alan Kilborn
            last edited by Mar 7, 2023, 2:35 PM

            @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.

            A 1 Reply Last reply Mar 7, 2023, 2:36 PM Reply Quote 2
            • A
              Alan Kilborn @Mark Olson
              last edited by Mar 7, 2023, 2:36 PM

              @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
              • C
                cisco779k
                last edited by Mar 7, 2023, 4:58 PM

                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
                • C
                  cisco779k
                  last edited by cisco779k Mar 7, 2023, 5:20 PM Mar 7, 2023, 5:19 PM

                  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)

                  T 1 Reply Last reply Mar 7, 2023, 6:51 PM Reply Quote 0
                  • T
                    Terry R @cisco779k
                    last edited by Terry R Mar 7, 2023, 7:28 PM Mar 7, 2023, 6:51 PM

                    @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
                    • C
                      cisco779k
                      last edited by cisco779k Mar 8, 2023, 10:14 AM Mar 8, 2023, 8:18 AM

                      … 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)

                      A L 2 Replies Last reply Mar 8, 2023, 12:20 PM Reply Quote -1
                      • A
                        Alan Kilborn @cisco779k
                        last edited by Mar 8, 2023, 12:20 PM

                        @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
                        • L
                          Lycan Thrope @cisco779k
                          last edited by Lycan Thrope Mar 8, 2023, 10:29 PM Mar 8, 2023, 10:27 PM

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