- February 27, 2010 at 8:15 pm #8136
is it possible (if so, how?) to filter lines by word or even regex filter, i.e. hide all non matching lines?
There are “grep” like programs or filters within log file viewers, but I only know “view”, not “edit”, alternatives.February 27, 2010 at 9:31 pm #8137Yutaka EmuraKeymaster
Do you want to “view” or “edit”? You can do all sort of replacements using regular expressions. That is “edit”. If you just want to view your changes, you can, of course, edit the file, and then close EmEditor without saving the file. In this way, you are not going to modify the original file, but you can still hide unimportant parts of the file.
To show you how to replace text using regular expressions, please show me an example file and how you want to change it to. Please let me know if you have further questions. Thanks!February 27, 2010 at 10:15 pm #8138
Thank you for your reply.
My first concern here is to “view”, but I could imagine the need to edit this special view.
Let’s suppose I have a log file – not a server log, but a debug output log. This could be something like
much, much longer of course. What I would like to view is
i.e., hide lines that don’t start with “Error:” (or, with other words, show only such lines). Such, I would have a very good overview of errors.
I cannot delete the lines between Error lines, because context will become important later on. I would like to find certain errors or certain details in the description and “expand” the file around this special error.
Maybe I’d like to add some comment to the lines for a colleague (“probably not important for the bug to be found” a.s.o.) – which is where the “edit” comes into play.
Do you think this use case it too uncommon? I, at least, could imagine similar requirements for csv files.
Maybe you could see it like a special kind of folding – fold everything between errors. In the meantime I remembered VIM, which has a folding by expression mode. Of course this is a bit complicated. It probably could be simplified for certain cases.February 27, 2010 at 11:47 pm #8139Yutaka EmuraKeymaster
You cannot just hide unimportant lines, unfortunately, but you can still extract lines that contain a specified string, and then view it as a separate document. Please try this macro:
If you still have further questions, please let me know.November 28, 2012 at 1:38 pm #10650
I get back to this topic.
Actually creating a new document is not what I really need. Interestingly, when I google for this kind of feature there are lot of requests, but apart from EditPad Pro no good answer. Maybe you want to check out how it is done there?
I think it would be a great new feature for EmEditor.
- You must be logged in to reply to this topic.