Community
    • Login

    Help me Replace in line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 230 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.
    • Daniel SoaresD
      Daniel Soares
      last edited by

      help me please I need to replace all the numbers 5 of several files in a specific line I was using the tool to replace everything, but I need to remove only one line specifically line 16

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Daniel Soares
        last edited by

        @Daniel-Soares ,

        • FIND WHAT = (?-s)\A^(.*\R){15}^.*?\K5
        • REPLACE WITH = [REPLACEMENT]
        • REPLACE ALL (multiple times)

        will change

        5 one       5 0 3
        5 two       5 0 3
        5 three     5 0 3
        5 four      5 0 3
        5 five      5 0 3
        5 six       5 0 3
        5 seven     5 0 3
        5 eight     5 0 3
        5 nine      5 0 3
        5 ten       5 0 3
        5 eleven    5 0 3
        5 twelve    5 0 3
        5 thirteen  5 0 3
        5 fourteen  5 0 3
        5 fifteen   5 0 3
        5 sixteen   5 0 3
        5 seventeen 5 0 3
        

        into

        5 one       5 0 3
        5 two       5 0 3
        5 three     5 0 3
        5 four      5 0 3
        5 five      5 0 3
        5 six       5 0 3
        5 seven     5 0 3
        5 eight     5 0 3
        5 nine      5 0 3
        5 ten       5 0 3
        5 eleven    5 0 3
        5 twelve    5 0 3
        5 thirteen  5 0 3
        5 fourteen  5 0 3
        5 fifteen   5 0 3
        [REPLACEMENT] sixteen   [REPLACEMENT] 0 3
        5 seventeen 5 0 3
        

        If this is not sufficient, I suggest explaining yourself better with example before and after data formatted as data, and otherwise follow all the advice that I will quote below; if you choose to ignore some or all of this advice, you will find that the answers you get are not overly helpful, because you’re making us guess, and we will guess wrong (in total or in part).

        ----

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