Eclipse find all in one file - eclipse

In Eclipse (CDT), is there a way to find all occurrences of a string in a single file? I can search the entire workspace easily enough using Ctrl-H, and can do "find-next" using Ctrl-F, but I want to be able to see a list of all matches for just one file.
It would be possible to do by setting up a custom file filter for each file I want to search, but that's very clunky. Eclipse should be able to work out which file I have open and just search that file.
This seems like it should be easy, but I can't find an appropriate option...does it exist?

Use CTRL+H and switch to File Search as you already mentioned, but set Scope to Selected resources. Now you can either search the current file, or selected multiple files and search all of them

Related

How can I find out what file mode VSCode is using for an open file?

I was trying to get yapf configured for a Python project, and so I created a .style.yapf file, which VSCode did not recognize by its extension. I thought it was in TOML format, but when I changed the file association for .style.yapf to TOML, the parser shows an error (because values aren't quoted). So I tried changing the name of the file (not really a solution, because the tool is looking for a file with that name), and found that if I change it to a name ending in .cfg, VSCode seems to parse and highlight it appropriately. Unfortunately, there doesn't seem to be anything in the list of file associations corresponding to this file mode.
I expected to find a cfg mode in the file associations list, but there wasn't an entry with that name, nor was there an entry that used the same gear icon displayed next to the open file name in its tab (which I have been assuming is an indicator of the mode that VSCode is using to display and format the file).
Is there any way for me to get VSCode to tell me what the current file mode is for an open file? Or give me a list of the default associations?
I'm more interested in understanding the tools in general than solving the one minor annoyance that sparked the question, but I'll settle for a solution to that problem, too.
Edit: Here's the content of the .style.yapf file in question:
[style]
based_on_style = google
If I rename the file to .yapf.cfg (or any other name ending in .cfg, I believe), it gets handled properly, but all of the file associations I've tried (including ini, Properties, and TOML) indicate an error because there are no quotes around google.

Powershell search for pattern with itextsharp.dll

I need to search pdf-files for patterns and then I just want the name of the files containing "region värmland", using that to copy the files to a different folder.
The pattern is in the top right corner, and if possible I would like to search as little as possible in the file due the number of files.
I could not find any relevant information when googleing how to just search for one set of words and keep the output inside the script for further use.
Anyone who can help with this?

window command prompt for searching

When you use window and go to a folder, there will be a search box and when you write something there, windows will automatically search the folder and all subfolders inside it for the keyword (it searches the title and the content of all documents also).
I just wonder if there is a way to perform that similar action but in command prompt (I want to search all types of file: pdf, txt,...)
I have tried find and findstr but findstr only searches text file and for find it returns wrong result for me. Because I know for sure that for example the word 'dangerous' is in a document but the result from find is 0
Do you want it to search the filenames for the keyword or the actual contents of the file? In such case i think you will need to write a simple c++ program to stream the data of each file and search for the keyword that way

Search for Folder Name Using Eclipse "Search in File"

How can I use 'search in path' for Eclipse Mars 2.0 to find a string pattern in either the name of a file and also find a string pattern in the name of a folder?
I have a folder named 'Personal Finance' in a git repo that I primarily use Eclipse to work with. When I search in file for 'Finance' the only search results that show up are in files themselves. Is there a way in Eclipse to search file names and folder names simultaneously?
Do not use Search dialog(Ctrl+H) for this. It searches inside the file content.
Use open resource dialog(Ctrl+Shift+R).
In the input pattern text box enter
<Folder/File NamePatter>/
For example:
*handler/
This will list all files which has handler string in their names and present under the folders which has handler string in their names.
*handler/*nature
This will list all files which has nature string in their names and present under the folders which has handler string in their names.
See this post for more details When typing in Open Resource dialog, is there a way to find files by directory instead of just the file name? also look into this bug and read all comments.
This may not interest to you but have a look on it:
In this blog you can find the details of a plugin which filters resource in package explorer view by name patterns. But now its limited to filter only projects. Go through this bug and this bug

Is there a way to get Eclipse's Open Resource dialog to search the middle of filenames automatically?

Eclipse's Open Resource dialog lets you search for project files based on a typed query, but the default behavior is to return only those filenames that start with the given query. You have to prepend a * wildcard symbol if you want the query to be interpreted as an arbitrary filename substring.
I'd say that 95% of the time, I'd want to prepend the wildcard. The default behavior for analogous dialogs, e.g. those in Visual Assist or Komodo, is to assume the query can be any part of the filename. I'm wondering if there's a way to force Eclipse to work the same way.
12+ years later, yes this is officially supported with Eclipse 4.27 (2023-03 release), from PR 12.
Open Resource dialog now defaults to "substring" search
By default, the search pattern input to the Open Resource dialog is now searched anywhere in the file name.
That means you no longer need to input a leading asterisk ("*") when searching from the middle of a file name.
If you want to enforce the old behavior, where "prefix-matching" search is expected, simply add a leading angle bracket (">") to the search pattern.
I don't think so. The UI you're talking about uses the FileDialog class which isn't really configurable in the way you describe. To me, that says that there's no preferences view that can alter that behavior. I certainly don't know of any nor could I find one.