Community
    • Login

    Trying to remove Line XXXXXX text in new document

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 3 Posters 32.3k 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.
    • Annmarie AltenhofenA
      Annmarie Altenhofen
      last edited by

      Hi all,

      Sorry for the simplicity of these issues - I love this product for its ability to work with data files which I deal with constantly. Specifically, I have a very large file with related records scattered about. I need to find all of one kind and then copy and paste them into a new document for testing. When I do this, I wind up with the Line XXXX: content in front of each line. This isn’t part of the original document/content - it’s a helpful tool to tell me where (in the original) it occurred. But, it’s hampering me as I have to remove that data from every line.

      023cbbcc-21b3-4d7d-a369-a505342bd568-image.png

      Is there a setting that allows me to remove the line numbers and anything that wasn’t originally in the file?

      Thank you in advance,
      Annie

      Alan KilbornA 1 Reply Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @Annmarie Altenhofen
        last edited by Alan Kilborn

        @Annmarie-Altenhofen

        Yes, right-click in the Search results window and choose Copy Selected Line(s) instead of Copy. If your lines are really long, check your results from doing this. There is a limit to how long the lines are shown in Search results and if they are too long, real data will be truncated on the right and a ... will be there instead. Likely this is not a problem, though.

        Alternatively, you can just copy from Search results as usual (select some data and press Ctrl+c) and then run the following Replace All operation on the data:

        Find: (?-is)^(?:Search.+\R| .+\R|\tLine \d+: )
        Replace: leave empty
        Search mode: Regular expression

        You only show “Line xxxx:” type lines, but the replace operation I showed will work if you happen to select and copy some of the other lines that get generated into Search results.

        1 Reply Last reply Reply Quote 2
        • Mark OlsonM
          Mark Olson
          last edited by

          FWIW it seems like my HugeFiles plugin might be useful here. I built it to deal with really enormous files that would take a lot of time and memory to load in their entirety.

          It has search-and-replace capabilities (with support for C# regular expressions - still a powerful engine, but less powerful than NPP’s Boost engine).

          The one caveat I’d mention is that while HugeFiles tries very hard to break documents into chunks that end at the end of a line, it may occasionally fail under the default settings, so you may find yourself having to do more work than you would like to tweak the settings to ensure that no lines are broken in two.

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @Mark Olson
            last edited by

            @Mark-Olson

            I don’t know from the OP’s OP that his problem was related to the size of files he works with; I mean, he did hint at working with large files but the problem experienced itself didn’t seem related.

            Anyways, good to know about your plugin…

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