Community
    • Login

    Custom select combos from a txt file before a suffix

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 366 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.
    • D Ream MenaD
      D Ream Mena
      last edited by D Ream Mena

      Hey guys

      I need help please to select or import some specific combos in a txt file ,The txt file is like

      testxx:textxx
      <------------>
      Test #1: 0
      Test #2: 3
      Test #3: 0
      <------------>
      test1:test1
      <------------>
      *********
      <------------>
      test22:test22
      <------------>
      *********
      <------------>
      testxx:testxx
      <------------>
      Test #1: 0
      Test #2: 1
      Test #3: 4
      <------------>
      

      Is there any solution to select or copy all combos before this suffix

      <------------>
      *********
      <------------>
      

      Like in the example file , i want to import these combos

      test1:test1
      test22:test22
      

      Thanks in advance

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @D Ream Mena
        last edited by

        @D-Ream-Mena,

        Since you want to “select or copy”, I would recommend using the Search > Mark dialog. I made some assumptions about your data, which may or may not have been accurate.

        • Find What = (?-s)^.+(?=\R<------------>\R\Q*********\E\R<------------>)
          Assumption: It needs to find exactly one line before each of your three-line suffixes, and there are no other rules as to what that one line must or must not contain
        • Enable ☑ Bookmark Line
        • Search Mode = Regular expression
        • Mark all

        Now that the lines are bookmarked, you can use the Search > Bookmark > … sub-menu for doing things like copying bookmarked lines, or deleting all the lines that aren’t bookmarked, or what have you.
        e0633e5f-1969-4d65-8fc9-177851d50bbd-image.png

        ----

        Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as plain text using the </> toolbar button or manual Markdown syntax. Screenshots can be pasted from the clipbpard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get… Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.

        1 Reply Last reply Reply Quote 3
        • D Ream MenaD
          D Ream Mena
          last edited by

          @PeterJones said in Custom select combos from a txt file before a suffix:

          (?-s)^.+(?=\R<------------>\R\Q*********\E\R<------------>)

          you re a genius broo thank youuu its worked

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