jEdit Community - Resources for users of the jEdit Text Editor
Selecting/Excluding lines of text
Submitted by jurrie on Friday, 2 November, 2007 - 16:59
When analyzing log files it can be handy to run with split views with each view being restricted to a particular subset of lines from the file in question. I'm trying to do something like this with jEdit and am looking for some guidance to steer me in the right direction. A search of the User's Guide and this forum didn't yield any obvious answers, possibly due to my use of inaccurate search terminology. Here goes:

1. how can I display only lines which match a certain search string (or pattern) ?
i.e. Show only lines with contain the string "MyLogEntry:"

2. how can I restrict the display content to only those lines which do not meet some exclusion content?
Ideally I'd be able to add and remove display filter restrictions dynamically.
i.e. Only show lines which do not contain the string "ComponentA:" nor the string "ComponentD:" nor the string "ComponentZ:"

In both of these cases I'd like to maintain the buffer's gutter and the ability display the original line numbers.

Is there a standard jEdit means of doing this?

Any guidance would be appreciated.
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
XSearch plugin
by frodesto on Wed, 14/11/2007 - 09:41

The XSearch plugin can be used select the lines that match a specific pattern.

Specify a pattern that matches the whole line, e.g.

.*SEARCH_STRING.*[\r\n]*

Untick the "hypesearch" box and select "Find All". All lines that match the pattern will now be selected (using jEdit's multiple selections feature). With a single copy-and-paste operation you now copy these lines to a new buffer.

To select all lines that don't match the pattern, just invert the selection after running "Find All" (Edit -> More Selection -> Invert Selection)

Log viewer plugin or Hypersearch results.
by elberry on Sat, 03/11/2007 - 09:18
You might take a look at the log viewer plugin to see if it has any of the features you're looking for.

You might also be able to use the HyperSearch results feature of jEdit. You might be able to use a regular expression to exclude things, and checking the hypersearch option will put the results (by line) in another window.

As far doing exactly as you say, I do not think that there is a way currently to hide parts of the text based on searches, but I may be mistaken.

You could always just do what I usually do, use grep and output to a text file to read in jEdit.

Learn from the past. Live in the present. Plan for the future.
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293