Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8136
    ujr
    Participant

    Hi,

    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.

    #8137
    Yutaka Emura
    Keymaster

    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!

    #8138
    ujr
    Participant

    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

    Info: abc
    Error: description1
    Info: cba
    Error: description2
    Trace: aabbcc
    Trace: dddd
    Error: description3

    much, much longer of course. What I would like to view is

    Error: description1
    Error: description2
    Error: description3

    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.

    #8139
    Yutaka Emura
    Keymaster

    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:

    http://www.emeditor.com/modules/mydownloads/singlefile.php?cid=8&lid=169

    If you still have further questions, please let me know.

    #10650
    ujr
    Participant

    Hi,
    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.
    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.