Trying to remove Line XXXXXX text in new document
-
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.
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 -
Yes, right-click in the Search results window and choose
Copy Selected Line(s)
instead ofCopy
. 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 expressionYou 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.
-
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.
-
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…