Search multiple strings in eclipse with AND operation - eclipse

I need to search throughout the work-space for all files containing "file1.txt" AND "file2.txt" as a string. How to achieve this in eclipse search?
possiblly duplicate of Search multiple strings in eclipse but not worked with file names and AND operation.

As far as I know, you can't, but as a workaround :
You could search for file name patterns file?.txt and then in the search view, click on the down arrow icon on the right, display as list and only doubleclick file1.txt and file2.txt matches

You will do two individual searches, one for file1.txt and one for file2.txt, and you will intersect the two results.
Step 1. Export the search results
As pointed out here , you can install the Eclipse Search CSV Export plugin. In the Marketplace, search for 'csv export' - it is the first result. Once installed, just perform a File Search as usual; in the Search Tab, in the bar, click on this icon (screenshot) named 'Export Search Results as CSV' to export the results as a csv file.
Obviously, you will perform a second search, and export those results, too.
Step 2. Convert the .csv file to .xlsx format
As shown here,in the section 'How to import CSV to Excel' , open Excel, go to Data tab > 'From Text', browse the .csv file; in the wizard, choose 'Delimited' (instead of 'Fixed width'), as Delimiters, choose 'Comma', preview the columns and click OK.
Now that you have converted the data into a more readable format, you can also Save as > .xlsx
Two columns are important here, Path and Location. I prefer Location, as it is an absolute location, not project relative.
Sort this column, select all its content, paste the content to a .txt file, save the .txt file. Do the same for your second search.
Step 3. Create the intersection of the lists of the Locations
At the previous step, you have copied the Locations column into a separate file, for each individual search. Navigate to Venn webtools , browse the .txt files and click Submit.The output will show the Intersection and the Differences between the two files. The Intersection represents the Locations of the files that contain BOTH your search strings - a functionality that should have been offered by the IDE. Please note that this tool allows up to 3 files to be uploaded.

Related

Full text search on content of documents

I need to save several files like pdf, docx, xslx etc..
I also need to make full text search on that files, for example, file named test.pdf that contains three lines:
firt test line
two my test line
three test line
Given an input like 'my' i need to extract file test.pdf
Can i do it with mongoDB or other tools (aws, alfresco?) ?

Neovim and telescope:find files with two strings

I am using telescope with Neovim to find files quickly. However, when I try to input two search strings seperate by space, telescope does not list any files. How can I search for files with two individual substrings in their path?
As Telescope is a fuzzy finder, you don't need to separate search by spaces, just type all together.
For example, if you have a file named some_python_script.py it will appear as a result of the query: somescript

Visual Studio Code file filter behavior

I've opened a folder in vscode and have a fairly a large file structure to navigate. It would be very helpful if I were able to filter across those files in a way that showed only the file names that containe the filter string while still showing their location in the file hierarchy. I could have sworn that I've done that before but now have lost it.
We do have highlighting in the Explorer pane, by selecting the explorer pane and starting to type. The difficulties there are that it:
Highlights files but doesn't eliminate unmatched files
Doesn't expand folders that contain the matched files
Does a confounding search that is the equivalent of putting a wildcard between each character typed
Do extensions exist that do all of the following?
Filter the file names based on search string (i.e., hides the unmatched files)
Expand the folders that contain the matched file names
Allows for exact search (or regular expression)

Eclipse find all in one file

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

How to skip .svn-base files in file search of Eclipse?

Whenever i perform a file search in eclipse, it scans all files including .svn-base file.
Provided i am using * for file name patterns.
Is it possible to scan all files for searching but skipping the .svn-base file?
It is possible. But the search pattern is inclusive and not exclusive. You can click on Choose button and select the file types you wish to see in your search results.
You also have custom plugins for excluding .svn and .cvs directories during searches.
If you have Subclipse, the search filtering is included.
Note: since Eclipse Helios 3.6M3 (October 30, 2009), you can actually exclude resources from your project, making the search more precise as a result.
alt text http://download.eclipse.org/eclipse/downloads/drops/S-3.6M3-200910301201/images/resourceFilters.png