Community
    • Login

    How to bookmark lines with certain characters in certain positions

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 402 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.
    • Brian Y.B
      Brian Y.
      last edited by

      Re: How to delete lines with missing characters in certain positions

      Thanks to this group, I know how to bookmark and then delete lines with missing characters in certain positions. Is there a way to bookmark lines that have certain characters in certain positions? For example, I’m trying to bookmark all lines that have an N in position 39 and a D in position 40.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Brian Y.
        last edited by PeterJones

        @Brian-Y ,

        It’s the same idea as in the post you linked to. The post you linked to wanted to find a space in the 18th character, so it looked for 17 of any character and then one space using ^.{18}\s

        You want ND in positions 39-40, so you want to look for 38 of any character followed by ND, thus ^.{38}ND

        ----

        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 3
        • Brian Y.B
          Brian Y.
          last edited by

          Ty for the quick reply…that gives me anything that has an N in position 39. Is there a way to test both positions within the same formula? Position 39 has to be N and Position 40 has to be D.

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @Brian Y.
            last edited by PeterJones

            @Brian-Y said in How to bookmark lines with certain characters in certain positions:

            that gives me anything that has an N in position 39. Is there a way to test both positions within the same formula? P

            The regex I gave does only match if N is 39 and D in 40, as shown in this screenshot below.

            a5a7d6ae-63eb-475c-b570-8313e33ef3e5-image.png

            1 Reply Last reply Reply Quote 1
            • Brian Y.B
              Brian Y.
              last edited by

              Gotcha. Thanks so much, that will really help.

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