Looking for a plugin that is able to search for exceptions
-
Hi, I’m managing an OBS scene Json, there are hundreds of cameras configured with few missing parameters, I need to search for them.
For example I’ve a string:"settings":{"buffering_mb":1,"clear_on_media_end":true,"close_when_inactive":true
which is what I want, but there is a hidden:
settings":{"clear_on_media_end":true,"close_when_inactive":true
I’m just counting occurences of “buffering” and discovere there is one less than “clear_on_media_end”, I have no idea where it is. I need to search for “clear_on_media_end” and chars before it that are different than “1,” " for example, that I know are right and I expect to find. Shortly I’ve to make a combination search for what exist and what should not be, and see occurences, then where are located.
There is any pluging which makes this combination search? Thank you -
@Giovanni-Gozzi said in Looking for a plugin that is able to search for exceptions:
“clear_on_media_end” and chars before it that are different than “1,”
As it seems that you are looking for static text I would suggest using the bookmark function to mark lines which do have this text, then invert the bookmarks which then highlight the lines without that text.
To do this select that text from 1 line which is correct, then select the Mark function. Once on that tab also tick bookmark and than mark all. Then go to bookmark in the menus and select option to invert those bookmarks, which are blue circles at start of selected lines.There is one issue though, if there are other types of lines they will also be selected, but you have only shown one line as an example. If this is the case it can be done with a regular expression, so come back with more details.
Terry
-
@Terry-R said in Looking for a plugin that is able to search for exceptions:
There is one issue though, if there are other types of lines they will also be selected, but you have only shown one line as an example.
As I’m now on a PC I thought I would provide the alternative I mentioned in the previous post.
Again, use the Mark function with the “bookmark lines” ticked, make sure the search mode is “regular expression” and insert the following into the Find What field
[023456789](?=,"clear_on_media_end")
As you can see it’s looking for a single number, anything but a 1 followed by the text you are keying on. This WILL mark the line(s) you are looking for, so no need to inverse the marks as the previous solution stated. F2 and Shift-F2 will move the cursor to next/previous bookmarked lines so easy to find once the mark function has completed.Terry
-
thank you Terry for your kind reply, sorry for delay on reply…
I’ve tried your method, but seams it suppose that the values I’m looking for are 023456789, in reality they may be anything else, letters, commas… I’m looking for differences, I’m looking for definitions which are not completed and I need to insert there the missing values. Usually the parameters appers in order, so I know what I expect to find, but if one parameter is missing I can’t figure out (rarely I do) what was the one before.Sortly I would love to find a plugin which is looking for “everything that exept this rule”, where for rule we say some values that should be and values that should differ.
Thanks -
@Giovanni-Gozzi said in Looking for a plugin that is able to search for exceptions:
in reality they may be anything else, letters, commas
I had wondered about that. It’s a simple change to my original regex to:
Find What:[^1](?=,"clear_on_media_end")
What this means is that single character cannot be the number 1, so anything else is what we are looking for.
Would that help?
Terry
-
@Terry-R said in Looking for a plugin that is able to search for exceptions:
Sorry mate but for me it’s a bit complicated, I don’t know if text chars are treated like numbers, for me it doesn’t work. I give you an example,
This is the tipical correct expression I should find:
buffering_mb":1,“clear_on_media_end”:true,“close_when_inactive”:true,Actually I have
176 occuries “buffering_mb”:1
175 occuries clear_on_media_end":true
178 occuries close_when_inactive":trueSomething is wrong into a 400KB file not formatted, impossible to visually search there.
Let’s find for example where close_when_inactive":true is not anticipated by a clear_on_media_end":true
I mark the expression ```
^d":trueThanks for help
-
I can’t more edit to correct the code, it’s considered spam from this forum. I try to post the end of the message here:
[^d":true](?=,"close_when_inactive":true)
it says one found and the bookmark is on the first line…
Thanks for help -
I did a little mistake, it seems it works :) let me work on it and I’ll report soon
-
How can I now check something after? is it correct like this?
this is the right expression “close_when_inactive”:true,“ffmpeg_options”:
("close_when_inactive":true?=)[^,"ff]
Can’t see results, thanks