Searching for files with specific file content - windows

I am trying to edit lot of files which has specific file content. I need to search for those files which have some content.
Is there any software which can do this type of search with huge accuracy.
I have tried searching using Windows 7 but looks like it misses many files.
Thanks.

The Windows native search can be quite limited ...
I'd suggest you look at the File Content Finder app on the Windows app store (disclaimer - I'm its developer). It's specifically designed for searching file contents without indexing. It supports all major file formats - pdf, doc(x), xls(x), pptx, and others. It can even search scanned documents.
Its filtering lets you optimise and refine your search by multiple criteria - file type, creation/modification dates, etc.

You can use FIND "string" pathname or FINDSTR "string" pathname(s)from the windows command line. See this guide.

I face this issue on a daily basis, and I've come up with two solutions:
Text editors, supporting the "find in file" feature (Notepad++ being a simple, free example).
Ubuntu app (from Canonical Group): UNIX/Linux supports finding in files, using the command find . -exec grep ....
As far as Windows search is concerned, its quality has reduced that heavily the latest versions that I've decided not to use it anymore.

Related

Windows search tool unable to find files content - Windows 7

Good morning,
I spent almost an hour, trying to find some lines of codes that I knew I had written somewhere but remember in which file.
I tried many things with the Windows search tool to find that file, such as using wildcards (* for a string, ? for a character) or using the content: filter, but it never managed to find it, whereas all files are indexed and I use the search tool often enough to know that it works in those folders (usually searching directly for a file name, not a content).
I did find the file eventually (just opening and scrolling through each of them...), but it still bothers me that this search below wasn't able to find this file, please see screenshot.
Is there any way it is actually possible to make this search work in W7 search tool? It's a .py file, so the content: filter should be able to search inside text files, should it not?

Windows search: how to find all files with specified extension and wildcard (like *.csv, *.log, etc)

Using the search input box in File Explorer, how do I find a filename with a specific extension?
Minimal, Complete, Verifiable Example
I'd like to recursively find all comma-separated files in a folder, typically with a .csv extension. For what reason I cannot fathom, all of the following attempts fail to provide this result; they give me a massive list of stuff that I don't need:
*.csv
.csv
name: *.csv
name:=*.csv
I would expect at least one of these to simply print all files with a .csv extension in a sortable list.
This is one of those maddening things that should be simple, but for some reason, is not. I will resist the urge to use profanity, and pine for the search from UNIX, Linux, Windows XP, etc.. which actually make sense.
I just use "csv" and make sure "All subfolders" is selected
Windows Desktop Search: Advanced Query Syntax:
ext:.csv
Windows 7: Advanced tips for searching in Windows:
System.FileName:~>".csv"
Not sure if there is a trick to stop it searching compressed containers or force it to search the entire disk instead of just the index.
Windows Search can never be trusted to find all files, use Everything, Agent Ransack or similar 3rd-party tools if you really are serious about file searching.

How to search text in Microsoft Word (.doc or .docx) files from command line or batch mode?

I need to search some text or phrases in Microsoft Word (.doc and .docx) files under several directories.
I'd like to use command lines or some .bat or .sh file (I can execute on windows or Ubuntu ....).
I've seen that there are some tips on using VBA in Microsoft Word but I'd like another way ......
Are there any tool / library or other things on this issue?
Any suggestions? Thank you very much in advance!!!
Cesare
There are a lot of tools but no all have the command line options. This links explain some possibilities : https://www.smashingmagazine.com/2009/04/25-text-batch-processing-tools-reviewed/
PowerGrep can search in MS-Word files and have a command line option:
PowerGrep can quickly search text and binary files, compressed
archives, MS Word documents, Excel spreadsheets, PDF files, OpenOffice
documents, Lotus spreadsheets, Zip files and more on a network and PC.
Regular expressions can be used to conveniently specify text to search
for. The best part is that you can search for binary data as well as
words and phrases. After searching and replacing, you have the option
to preview the results without modifying any files. You also benefit
from flexible backup and undo options, which are icing on the cake.
PowerGrep runs on Windows 98/ME/NT4/2000/XP/Vista. One other feature I
like is being able to save PowerGREP actions and invoke them from the
command line to automate recurring tasks. Developers can integrate
PowerGREP actions and results with enterprise software through
PowerGREP’s open XML file formats.

Windows Installer Detection: What's the full list of keywords?

On Microsoft's website about UAC and in several existing answers and articles (like this one) it is mentioned that the Installer Detection of Windows checks the assembly for certain keywords for detecting if the application is an installer or not:
Before a 32 bit process is created, the following attributes are checked to determine whether it is an installer:
Filename includes keywords like "install," "setup," "update," etc.
However, I could not find a full list of those keywords. Only "install," "setup," "update," etc. is mentioned even on Microsoft's website. So what are the "cetera"?
Probably the closest you'll find to a "full list of keywords" is to read the shim database itself at %windir%\AppPatch\sysmain.sdb. (And possibly other .sdb files in the same folder).
The sdb2xml utility seems to do a good job of parsing it. The XML output from the sysmain.sdb on my Windows 7 x64 system can be found here.
A useful starting point would be to search the file for the string "GenericInstaller". You'll find <exe> profiles matching against filenames ("*instal*", "*setup*", "trustedinstaller.exe", etc.), checksums, file version information strings ("InstallShield*", "RTPatch Executable", etc.) and other various attributes. It sometimes even recognises the presence of other files such as "EULA.rtf".
To extract a full list of filename patterns used for installer detection is a bit nontrivial since there seems to be a number of different classifications for installers ("GenericInstaller", "SpecificInstaller", "MozillaFirefoxSetup", etc.). But I'm sure anyone who's read this far will be able to find the information they need by digging around in the XML.
The full list is probably undocumented on purpose and might not be the same on all versions of Windows. It might also include ISVs that Microsoft do not want to shame in public.
As MSDN says, the filename is not the only trigger and I know that NSIS installers are detected based on a byte signature.
The correct way to deal with this is to make sure your installer is Vista/UAC compatible and add a requestedExecutionLevel node to your manifest.
If on the other hand you actually wanted to trigger the detection then I assume you can just add a keyword to your version resource or string table...

How to search Jar files using Windows Search?

I believe back when we were on Win2K, Windows Search would search through Jar files to locate specific classes but this doesn't appear to work in XP. Does anyone know how to enable this in XP?
Note, to do the search in Win2K we just entered *.jar for the files and "ClassABC" for the search text string and the search would return any jar files containing class files where the title contained "ClassABC".
Add this to a text file, save file, change the extension to .reg, double click to add to registry and you should be ok...you can search on file name or content and it should show jars that have class names
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.jar\PersistentHandler]
#="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
The only thing left is to logout and log back into windows and it should work fine for you, see http://support.microsoft.com/kb/309173 for more details
I would also recommend total commander. It is a great file management tool with great search functionality which can easily look inside jar files.
If it was removed it was likely due to the Sun-Microsoft Java dispute that was going on around the time XP was developed. It's unlikely to have a way of re-enabling it.
You might find this helpful instead: http://jarbrowser.sourceforge.net/
Just use FindClassInJars util, it's a simple swing program, but useful.
You can check source code or download jar file at http://code.google.com/p/find-class-in-jars/
I made another version of FindClassInJars here. It is the same look but searches a little better and smarter. Click the "Raw button here:
https://github.com/Oxvalley/FindClassInJars/blob/master/lib/findclassinjars-2.0.0.jar
According to this MSDN Channel 9 article, adding an appropriate IFilter will do it. Since .jar files are the same as .zip files, one of the four ZIP file IFilters they list might work (unless they are all extension-based).
From Brenden Anstey's Blog:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.jar]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
#="CompressedFolder"
[HKEY_CLASSES_ROOT\.jar\CompressedFolder]
[HKEY_CLASSES_ROOT\.jar\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.jar\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.jar\PersistentHandler]
#="{098f2470-bae0-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\.war]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
#="CompressedFolder"
[HKEY_CLASSES_ROOT\.war\CompressedFolder]
[HKEY_CLASSES_ROOT\.war\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.war\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.war\PersistentHandler]
#="{098f2470-bae0-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\.ear]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
#="CompressedFolder"
[HKEY_CLASSES_ROOT\.ear\CompressedFolder]
[HKEY_CLASSES_ROOT\.ear\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.ear\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.ear\PersistentHandler]
#="{098f2470-bae0-11cd-b579-08002b30bfeb}"
I know that it's not Windows Search, but I have long used Agent Ransack for this: it is very quick and searches through all the various java archive formats (jar, war, ear) as well as zip.
A feature that I particularly like and use a lot is saving a search: you can save the criteria (so that you can repeat that search easily) or the results.. So when I am working on a project, I will often want to search through the project directory tree for a file (or a file within a jar/zip). I perform the search once and save the criteria as a .srf file, which I can open quickly to perform similar searches afterwards.
As suggested by #iubing, the FindClassInJars code works fairly well, but the author must have botched the packaging.
I've forked the FindClassInJars util from google code, you can get a built copy here that works. Just click the "raw" button.
a while back I developed this: https://github.com/javalite/jar-explorer just for the occasion. works even on windows :)

Resources