Community
    • Login

    delete all lines that start with specific litter

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 4 Posters 13.9k Views 1 Watching
    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.
    • Fahad AlotaibiF Offline
      Fahad Alotaibi
      last edited by Fahad Alotaibi

      hi, i have a HUGE txt file that have more than 100,000,00 lines.
      i want to delete any line that start with the letter P ( the entire line not just the letter P )

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @Fahad Alotaibi
        last edited by

        @Fahad-Alotaibi

        Use Regular expression replacement:

        Search for ^P.*\R
        Replace with nothing.

        Fahad AlotaibiF 1 Reply Last reply Reply Quote 3
        • Fahad AlotaibiF Offline
          Fahad Alotaibi @Alan Kilborn
          last edited by Fahad Alotaibi

          @Alan-Kilborn
          Thank you, i tried it but didn’t work for me
          alt text

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA Offline
            Alan Kilborn @Fahad Alotaibi
            last edited by

            @Fahad-Alotaibi

            Well, this site is about help with Notepad++.
            Not sure what text editor you showed the screenshot from, but it is not Notepad++.

            Fahad AlotaibiF 1 Reply Last reply Reply Quote 0
            • Fahad AlotaibiF Offline
              Fahad Alotaibi @Alan Kilborn
              last edited by

              @Alan-Kilborn
              i know , i used what you said with notepad++ didn’t work so i tried another txt editor and still didn’t work

              Alan KilbornA PeterJonesP 2 Replies Last reply Reply Quote 0
              • Alan KilbornA Offline
                Alan Kilborn @Fahad Alotaibi
                last edited by

                @Fahad-Alotaibi

                I probably should have been a bit more specific with my regular expression:

                (?-s)^P.*\R

                But really, show how it looks in Notepad++, not some other editor (that just confuses things).

                1 Reply Last reply Reply Quote 3
                • PeterJonesP Online
                  PeterJones @Fahad Alotaibi
                  last edited by

                  @Fahad-Alotaibi said in delete all lines that start with specific litter:

                  I used what you said with notepad++ didn’t work

                  Then you did something wrong.

                  Before:

                  P123456
                  Q123456
                  P123456
                  P123456
                  M123456
                  

                  15b5eb2a-e1cb-41f8-a85e-5fea18ac3b2f-image.png
                  Replace All
                  After:

                  Q123456
                  M123456
                  

                  23cb71df-c29b-4c94-a060-987adfd32a24-image.png

                  See, it deleted all the lines that started with P

                  If it doesn’t work for you, follow the same steps I just showed, including screeenshots.

                  A 1 Reply Last reply Reply Quote 2
                  • A Offline
                    angel_heart @PeterJones
                    last edited by

                    @PeterJones thanks solved my problem too

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors