Page 1 of 1
Find with list of no matches
Posted: 23 Nov 2021 21:27
by hermhart
This may be a little far fetched, but if I do a find of a very long list of delimited search names, is it possible to get a list of what there were no matches for as well?
Example:
Find Name: 123;234;345 etc
Somehow get a list if it did not find anything matching: 234 etc
Re: Find with list of no matches
Posted: 23 Nov 2021 21:44
by jupe
If I am understanding you correctly, you can just suffix your search term with
/i
which will show everything that doesn't match your search
Re: Find with list of no matches
Posted: 23 Nov 2021 21:53
by highend
I guess he wants to know which of these (single) patterns in the delimited list of all patterns did not find a result
Sure, possible. But only via scripting^^
Re: Find with list of no matches
Posted: 23 Nov 2021 22:00
by hermhart
Yes, highend, what you mentioned is the goal that I am trying to attain.
Re: Find with list of no matches
Posted: 25 Nov 2021 00:26
by jupe
Not sure if your interested in my janky version, but below is an outline of one way to accomplish it, you should be able to massage it into a suitable script, depending on your search terms you may need to regexescape the string:
Code: Select all
$term = input("enter search term with NO switch suffixes",, "123;234;345");
$find = quicksearch($term, , , "s");
$findN = report("{Name}<crlf>", $find);
$nomtch = "";
foreach($q, $term, ";", "e") { if !(regexmatches($findN, $q)) { $nomtch .= "$q<crlf>"; } }
if ($find) { paperfolder("TEMP-<date ddmmyyyy>", $find); }
if ($nomtch) { text $nomtch; }
currently the search just runs in curpath and is recursive, modify as required.
Re: Find with list of no matches
Posted: 25 Nov 2021 01:06
by highend
@jupe
I can't recommend doing this: $findN = report("{Name}<crlf>", $find);
If you have e.g. a list of 50k matches, this is a very time consuming process
Instead of escaping the pattern you could use a formatlist()
to achieve the same (mind the last arg with "f")
Re: Find with list of no matches
Posted: 25 Nov 2021 01:11
by jupe
Well the op is free to change whatever he likes if he is going to have results that large, I was just providing a quick outline using cmds that should be understandable for people new to scripting, which to me is more useful when posting on the forum, than using regex which can appear as incomprehensible to some people, so could actually discourage people from trying to learn scripting because they might think it is required.
Re: Find with list of no matches
Posted: 30 Nov 2021 01:04
by hermhart
Thanks for the script, guys, this gives me a good place to start. Sorry for the delay in responding, didn't get an email letting me know there were updates.