Perforce P4v: How to find file with a list of file to be find? - perforce

Is there a way or command to be use to find files using a list of files to be find in a directory?
e.g.
find the following files:
text1.sql
text2.sql
text3.sql
text4.sql
text5.sql
text6.sql
Search in: c:\archive...

Not sure if this is what you are looking for, but try the following:
Search > Find File...
Enter the directory under "Search in:"
Enter the name of the file you are looking for under "Name contains:"
Click on Find.
I'm using the P4V client version 2012.1

Just putting out there that Saulo's answer is correct, however that Rev. Perforce Visual Client/NTX86/2008.2/188141 doesn't support it. So you probably need to upgrade if you don't have the menu option (as I had to).

Related

Sublime: Quickly check where file is used?

I often find myself needing to check where a file is used in my node project (which other file imports it). What I'm doing now is right clicking on the editor showing my file, copying the file path, then doing a grep on my whole project using the filename. In this manner I'm able to 'walk up' the dependency tree.
However, I'm wondering if it'd be possible to make a shortcut for this sort of thing. Does anybody know if that's viable?
Include your node project root directory to a sublime project with Project / Add Folder To Project...
Right-click on the project directory in the sidebar, then select "Find in Folder..." from the context menu.
Enable Regular expression
Find: import.*filename
click on Find
filename must be replaced with the actual name. The search pattern can be further refined to match module names from 'filenames', for example. You will end up with a search buffer that lets you jump to each file for that a match has been found.
Maybe Find In Files , Activate with ctrl + shift + F

How to search only in currently open files in vscode?

I usually work on larger projects with many files that would contain the search query. So I would open the files I want to modify and do a find/replace across all currently opened files. Can this be done in vs code?
The feature I'm looking for is implemented in Notepad++, but I'd prefer not to have to switch editors for this task.
For me somehow it works just by typing ./ in the files to exclude field.
The ability to search only in the open editors is in the Stable Build v1.55.
As you can see, the icon is at the end of the files to include input so you will have to have that showing (click the three dots ... just below the search options if files to include is not already showing).
"Search: target particular set of files #20530" located here: https://github.com/Microsoft/vscode/issues/20530
Is tracking a search "scope" such as "all open files".
Hit Ctrl + Shift + F and enable the icon at the end of the 'file to include' text field
I don't think there's a way to do this. You can make a feature request on github. I think an extension could do it though.
There is a checkbox for this in the "files to include" field since version 1.55 (march 2021).
The answer was already mentioned (and accepted above) indeed typing ./ in the files to exclude box of the search window will allow you to only search in open files.
However the response mentioned that he was unsure why this worked. VSCode allows you to exclude all files in a directory by writing the directory in the exclude box. The directory . is the directory where VSCode is opened ie the root directory. The filter ./ excludes all files in the VSCodes root directory so all files are excluded. However opened files ignore any exclude filter. So if you exclude all files only the opened files will be searched.
The best way to find something you are searching for within a specific file in vs code would be:
Ctrl + p then pressing # on the search bar.
It will give you a list of all functions on the file, which makes it easier to track something down.
As an alternative to using Visual Studio Code itself, you can just search the file contents within the folder where unsaved files open in Visual Studio Code are located. This would be in one of these locations depending on which OS you are running:
Linux: /tmp/ (someone else running Linux can verify this)
macOS: ~/Library/Application\ Support/Code/Backups/
Windows: %APPDATA%\Code\User\
This extension is what I use for this purpose.
You may need to change the keybinding if there is a conflict.

IntelliJ File mask not working on simple excluding file pattern! Why?

Follows this page https://www.jetbrains.com/help/pycharm/2016.1/find-and-replace-in-path.html?origin=old_help#mask , it should be able to exclude many files using "!" symbol in front of the regular pattern like: *.java, when doing text search inside IntelliJ projects.
On my project, when I fired Ctrl + Shift + F to do text search for string xyz. There's over 100+ results return in both *.ftl and *.java files. I tried to reduce the results on only ftl files by changing the "File mask(s)"-Option to "!*.java" . But it did not work! The result list is empty!
Googling on the excluding file pattern results in creating custom file filters for each particular search, which I don't want to maintain!
Do I miss something here or IntelliJ is just bad on this function (I'm using IntelliJ 15)? With Eclipse, the "File mask" was amazing!
You have to use
!*.java instead of !.java
As for IDEA 2019.1 Ultimate, it works for me(exclude with !*.yml or anything else).
If it does not in yours, as you only as .ftl file to exclude, why not add mask as *.java?
PS: what does not work is exclude some path, like "all files under out/ folder". With !out/* or anything ales it does not work.
Forget about File Mask and use Scope:
In Scope the options are unlimited where you can select folder include/exclude files or folders.
Excluding file paths in the Find in Path dialogue was not added until IntelliJ 2016.1 per this IntelliJ forum response.

In Sublime Text, how do I find and replace the file name

Is there a way in sublime text where I can find a pattern and replace it with file names.
For example,
I have a bunch of file names that contain people.
I want to replace that with person.
in SideBarEnhancements there is an option to Mass Rename Selection... under Find Advanced to batch rename multiple files.
Menu: Find -> Find in Files...
Sublime is gonna open a new panel at the bottom, you just need to fill the fields. Inside the field Where, you can, for example, look up only for .txt files:
Find: People
Where: C:\Temp, *.txt
Replace: Person
No you cannot do a find and replace on a filename. Although there is a great package called SideBarEnhancements which would benefit from this feature. I will definitely submit a feature request.
Install the SideBarEnhancements plugin
Select the folder from side bar
Right click and open the context menu
From Find Advanced -> Mass Rename Selection... you can do this.

How do I search historic mercurial file content?

I've found an issue in my code where something used to be specified, but is no longer, so I want to search for a particular string through the history of the repository.
Is there a way to do this in TortoiseHg? I know it would take a while, but it'd take me longer...
If you don't mind working with Mercurial via the command line, there's hg grep. It's probably exposed somewhere in the TortoiseHg Workbench, but I don't know.
Menu "View" -> "Search". This will open the search pane which you can use to search for strings inside your
working copy, all history, specific revision
with inclusion file patterns
and exclusion file patterns

Resources