4

Each time I've been looking for "something I don't know exactly what" in big text file, e.g. log-file, huge shell script, I wish to hide all the lines of certain types.

I wish to select certain lines with a set of regexps and either hide them or highlight.

It would be nice if I could select line blocks e.g. those lines between "function ...() {" and corresponding "}"

can you suggest me such a viewer?

4
  • I like egrep although it has to be used from the terminal. Assuming you are in the directory that holds the file called input, egrep -v '^#|^ *$' input > output will exclude lines that are commented with a # at the beginning of lines and lines that are not blank and write the results to the file called output in the same folder. Obviously, you can modify the criteria depending on the content of your file.
    – user25656
    Jan 30, 2012 at 16:45
  • Many text editors will do syntax highlighting. Tools such as grep, awk, perl will help you search your logs.
    – Panther
    Jan 30, 2012 at 16:51
  • yes i'm aware of grep, awk, other cool text processing stuff, but in the context I described abowe I find them not convenient. I need GUI viewer with ability to switch on/off certain regexp by clicking a checkbox, also it would be very helpful to have an option to extract to separate tab all the lines with defined regexp.
    – zuba
    Jan 30, 2012 at 18:49
  • 1
    gnome-system-log has such filters but they are implemented such way, that I could hardly use them.
    – zuba
    Jan 30, 2012 at 18:56

4 Answers 4

4

Here are 5 of the best viewers

MultiTail View multiple logfiles windowed on the console

System Log Viewer A system log viewer for GNOME

KSystemLog System log viewer for KDE 4

Xlogmaster GTK+ based program to keep track of logfiles and devices

Swatch Logfile viewer with regexp matching, highlighting & hooks

source

0

Have you tried regexxer? It can highlight matches and you can jump from match to match but it won't filter just matches. Similarly like gnome-system-log but more easy to use

I could also show you how to filter regex matches (display only matching lines) in SciTE editor, with small LUA script, and I imagine many others can show you how to with vim or emacs, but you didn't mention which editor you use.

1
  • Thank you for url, I found regexxer very helpful utility. But I need other tool. When I look at a file which contains many lines e.g. when I study ubuntu logs, I want to hide all the lines I know meaning of. That helps to unearth lines I'd like to learn more about. I prefer gvim.
    – zuba
    Jan 30, 2012 at 20:35
0

You can try Geany [GUI]

regx for multiple line is not supported bust you can use - and + to hide/show portion of text such as functions ({...}).

It support may languages including xml.

http://www.geany.org

0

Have you tried vim with folds? It can fold code blocks very well.

:set foldmethod=indent

This command sets fold method based on indentation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .