request:find strings that are not in files of tab

Discuss and share scripts and script files...
40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: request:find strings that are not in files of tab

Post by 40k »

DmFedorov wrote:40k
With your script I receive

F:\_New\inspector.js
You need to install a Chrome extension
Remove all DOM breakpoints
Save entry as HAR
----------------
F:\_New\NetworkPanel.js
You need to install a Chrome extension
Remove all DOM breakpoints
Save entry as HAR
----------------
F:\_New\ProfilesPanel.js
You need to install a Chrome extension
Remove all DOM breakpoints
Save entry as HAR
----------------
F:\_New\ResourcesPanel.js
You need to install a Chrome extension
Remove all DOM breakpoints
Save entry as HAR
----------------
Well on my test the script works.
You've got to make absolutely sure that you only enter 1 string per line in the in.txt file. You also NEED to push ENTER after every line, including the string on the last line.
Can you upload the *.js files you are using? I have a feeling there's probably another factor involved that neither highend nor I can recreate without seeing the files.
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

highend
Posts: 13311
Joined: 06 Feb 2011 00:33

Re: request:find strings that are not in files of tab

Post by highend »

I have a feeling there's probably another factor involved that neither highend nor I can recreate without seeing the files
I'd say they use a weird encoding... so regexreplace / strpos aren't able to get their matches...
One of my scripts helped you out? Please donate via Paypal

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: request:find strings that are not in files of tab

Post by DmFedorov »

highend wrote:You mean: It's only missing in the file "inspector.js"...
No, it missing in all files, but I have in output this:

F:\_New\inspector.js - Save entry as HAR
F:\_New\NetworkPanel.js - You need to install a Chrome extension|Remove all DOM breakpoints|Save entry as HAR
F:\_New\ProfilesPanel.js - You need to install a Chrome extension|Remove all DOM breakpoints|Save entry as HAR
F:\_New\ResourcesPanel.js - You need to install a Chrome extension|Remove all DOM breakpoints|Save entry as HAR
highend wrote:You've said that you want the file together with the missing strings, so the output should still be:
D:\Temp\test\inspector.js - Save entry as HAR
I don't said it and don't want it. If I will have not 4 files, but 100 files, I will have 100 strings with missed in this files "Save entry as HAR"
Off course i want see only such strings that missed in all files, and only one time.

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: request:find strings that are not in files of tab

Post by 40k »

DmFedorov wrote:
highend wrote:You mean: It's only missing in the file "inspector.js"...
No, it missing in all files, but I have in output this:

F:\_New\inspector.js - Save entry as HAR
F:\_New\NetworkPanel.js - You need to install a Chrome extension|Remove all DOM breakpoints|Save entry as HAR
F:\_New\ProfilesPanel.js - You need to install a Chrome extension|Remove all DOM breakpoints|Save entry as HAR
F:\_New\ResourcesPanel.js - You need to install a Chrome extension|Remove all DOM breakpoints|Save entry as HAR
highend wrote:You've said that you want the file together with the missing strings, so the output should still be:
D:\Temp\test\inspector.js - Save entry as HAR
I don't said it and don't want it. If I will have not 4 files, but 100 files, I will have 100 strings with missed in this files "Save entry as HAR"
Off course i want see only such strings that missed in all files, and only one time.
Well that was not clear from your initial post.
You want the strings that are missing in any files only to show once?
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

highend
Posts: 13311
Joined: 06 Feb 2011 00:33

Re: request:find strings that are not in files of tab

Post by highend »

It's (almost) christmas, I'd rather not to ask who wasn't clear on what he needs exactly...

I'm just to lazy to spend more time on it... Now it takes 3 times longer but I guess that's what he wanted...

Code: Select all

    // Searches all text files in the current folder for non matching terms
    $searchStrings = input("Enter the search terms...", "Terms MUST be separated by |", , "s", "none", 600, 200);
    if ($searchStrings == "" || $searchStrings == "none") {
        $searchStringsFile = inputfile("<curpath>", , "You did not enter any search terms, please select the file that contains them...<crlf>Terms MUST be separated by |");
        $searchStrings = readfile($searchStringsFile);
    }

    $allFiles = listfolder(, "*", 1, "|");

    $notFoundStrings = "";
    foreach($string, $searchStrings, "|") {
        $countNotFound = 0;
        $searchedFiles = 0;
        foreach($file, $allFiles, "|") {
            if (filetype($file) != "Binary") {
                $searchedFiles++;
                $fileContent = readfile($file);
                if (strpos($fileContent, $string) == -1) {
                    $countNotFound++;
                }
            }
        }
        if ($countNotFound == $searchedFiles) {
            $notFoundStrings = $notFoundStrings . $string . "<crlf>";
        }
    }
    text $notFoundStrings;
One of my scripts helped you out? Please donate via Paypal

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: request:find strings that are not in files of tab

Post by DmFedorov »

Yes!!

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: request:find strings that are not in files of tab

Post by DmFedorov »

Absolutely what I wanted.
The only BUT - it is certainly more convenient through the list of files, but this is not a problem.

A great big thank you.

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: request:find strings that are not in files of tab

Post by DmFedorov »

40k wrote:Well on my test the script works.
You've got to make absolutely sure that you only enter 1 string per line in the in.txt file. You also NEED to push ENTER after every line, including the string on the last line.
Can you upload the *.js files you are using? I have a feeling there's probably another factor involved that neither highend nor I can recreate without seeing the files.
I have pushed extra Enter, but there is something.. on
$content = readfile($file, 't', , , );

or with variables.

There was error. I have no rights. and so on. But not now.
----------------

Thank you.

Post Reply