Find Files in Folder - Search Query Includes Parentheses - power-automate

I have a flow that pulls a list of filenames from an Excel file and then looks for them in a folder. Sometimes the filenames have parentheses in them, which causes issues with the search query and it doesn't even look for the file. I'm not sure how to handle the parentheses, but I don't want to remove the parentheses from the filenames (and ergo the search query). I thought about trimming the parentheses from the search query, but I want to make sure the right file is found. Perhaps I just need a way to escape the parentheses? I'm not sure how to do that though.
Here's a picture of the flow section in question:
I tried to find another post on this but after searching for a while I couldn't find anything, so I'm sorry if this has been answered already!
Any help is appreciated!
Edit: I'm going to try replacing any parentheses found with %28/%29 per Expiscornovus' suggestion.

Can you use a different search mode in the settings of your Find Files in Folder action (OneDriveSearch instead of Pattern)?
Ignore my previous suggested encoding. Inputting the Search query with parentheses should work. Look at the example below.

Related

Find but skip strings and comments?

One thing that constantly annoys me about VS is that when I do a Find or Find all, it looks in comments, strings, and other places. When I'm trying to find a particular bit of code, like and rent, it finds it all over. Is there a way to limit searches just to code?
Not sure if there is a specific setting to ignore comments, but you could do a regex find. For example, assuming you want to find "text", you could use this:
^(?!\s*?//).*?text
Caveats:
Assumes comments start with // as first non-whitespace characters. E.g. C# comment types
Doesn't work for comments at the end of code lines (only comments on their own lines)
Doesn't work with block comments, for example /* comment */
So overall it isn't perfect by any means, but depending how many hits you are getting, it might help to cut them down which can be useful if you have a lot of false positives in one-liner comments
The 'Find All References' function may suit you : it ignores all commented-out code and text in strings. CTRL+K, R is the keyboard shortcut.
(Note that it's designed for going from a specific instance of a search string to all other instances. so if you haven't already found an instance of what you're searching for, you would have to (temporarily) type one in to the editor window, then search. Also it's not available for all languages : I know it works fine for C#, though.)

MediaWiki search in <syntaxhighlight> tag (SyntaxHighlight GeSHi extension)

How to enable searching in <syntaxhighlight> tag (SyntaxHighlight GeSHi extension)? I'm trying to search for com.android.chrome in it, but no result found :-(. String is IMHO long enough to be found.
<syntaxhighlight lang="java">
supproclist.add("com.whatsapp");
supproclist.add("com.android.chrome");
</syntaxhighlight>
You don't need to do anything special; everything within <syntaxhighlight> tags is already included in the normal site-wide search system (based on MySQL search).
Edit: You definitely should be getting a match on com.android.chrome. Is this on a public wiki? Can you provide a link?
You won't get a result when searching for com.android however, because the search system only finds whole words, and the dot is considered part of the word. This is quite separate from, and not changed by, the SyntaxHightlight extension.

Mac OSX Finder file search for: -1. = no results... EVER

Let's say I have a folder on my desktop with the following files:
file_c.txt
file_c-1.txt
file_b.txt
file_b-1.txt
file_a.txt
file_a-1.txt
Then, I do a finder search, in the folder, looking at the filenames and not the content.
If I enter a search criteria of: -1.
I get NO results!
Also, I cannot seem to find ANY documentation on escaping, wildcarding, or anything on the search function inside a folder....
Does anyone know how to search for this type of filename? I have a client that I have to constantly filter out these types of files from the contents of a folder on my desktop, so it would be REALLY helpful to simply search for them and delete them en mass.
Anyone run into this before? And how did you resolve it?
You need to enclose the search string in quotes: "-1." which now should give the result you want.
I banged my head on a desk for a long time before I figured this one out by accident.
I also count'd find anything online... weird.

Insert a hyperlink to another file (Word) into Visual Studio code file

I am currently developing some functionality that implements some complex calculations. The calculations themselves are explained and defined in Word documents.
What I would like to do is create a hyperlink in each code file that references the assocciated Word document - just as you can in Word itself. Ideally this link would be placed in or near the XML comments for each class.
The files reside on a network share and there are no permissions to worry about.
So far I have the following but it always comes up with a file not found error.
file:///\\165.195.209.3\engdisk1\My Tool\Calculations\111-07 MyToolCalcOne.docx
I've worked out the problem is due to the spaces in the folder and filenames.
My Tool
111-07 MyToolCalcOne.docx
I tried replacing the spaces with %20, thus:
file:///\\165.195.209.3\engdisk1\My%20Tool\Calculations\111-07%20MyToolCalcOne.docx
but with no success.
So the question is; what can I use in place of the spaces?
Or, is there a better way?
One way that works beautifully is to write your own URL handler. It's absolutely trivial to do, but so very powerful and useful.
A registry key can be set to make the OS execute a program of your choice when the registered URL is launched, with the URL text being passed in as a command-line argument. It just takes a few trivial lines of code to will parse the URL in any way you see fit in order to locate and launch the documentation.
The advantages of this:
You can use a much more compact and readable form, e.g. mydocs://MyToolCalcOne.docx
A simplified format means no trouble trying to encode tricky file paths
Your program can search anywhere you like for the file, making the document storage totally portable and relocatable (e.g. you could move your docs into source control or onto a website and just tweak your URL handler to locate the files)
Your URL is unique, so you can differentiate files, web URLs, and documentation URLs
You can register many URLs, so can use different ones for specs, designs, API documentation, etc.
You have complete control over how the document is presented (does it launch Word, an Internet Explorer, or a custom viewer to display the docs, for example?)
I would advise against using spaces in filenames and URLs - spaces have never worked properly under Windows, and always cause problems (or require ugliness like %20) sooner or later. The easiest and cleanest solution is simply to remove the spaces or replace them with something like underscores, dashes or periods.

How to Google for --depend?

The latest makefiles we've received from a third party vendor contain rules with --depend on the end of build rules, so I thought I would look it up on Google, but try as I might, I can't persuade it to display any pages with exactly the characters --depend
I've tried surrounding it with quotes "--depend": I've tried the Advanced Search: I've tried backslashes "\-\-depend" in the (vain) hope that there is some sort of unpublished regular expression search available.
Am I missing something blindingly obvious?
Please note that this is NOT a question about what --depend does, I know that, it's a question about how you Google for very precise, programmer oriented, text.
You can specifiy literal symbols in a Google Code Search but not Google Web Search.
Examples;
Google Code Search for +"--depend"
Google Web Search for +"--depend"
I had the same issue searching for 'syntax-rules'. You would think they would have solved this by now.
I remember to have read somewhere that google's web search does not index non alphanumeric characters, treating them as word separators, so that's not possible.
Reason for this problem is that a minus sign at the start of a token indicates that you want to EXCLUDE it from the search.
This is how you can filter out really popular results that really have nothing to do with you want.
For example, try searching for "wow". Then try searching for "wow -warcraft".

Resources