Community
    • Login

    delete all lines that start with specific litter

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 4 Posters 8.7k 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.
    • Fahad AlotaibiF
      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
        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
          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
            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
              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
                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
                  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
                    angel_heart @PeterJones
                    last edited by

                    @PeterJones thanks solved my problem too

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