Searching and Marking
-
Fellow Notepad++ Users,
Could you please help me the the following search-and-mark problem I am having?
I generally use Notepad as a text editor for coldfusion and oracle sql code. What I’m wanting to do is find all the columns in a document which are referenced by the column alias such as “a.bfy” for the table “faos a”. I want to mark those instances and copy the marked text…if that’s possible.
Here is the data I currently have (“before” data):
Select a.* from faos a where ...... * represents to me a wildcard, which could mean any column in the table such as "a.bfy", "a.fund_cd",
I have done a few searches for an example and looked at the manual, but it is so freaking confusing and I don’t understand it.
Thanks so much for any help.
-
@Sherry-Porras said in Searching and Marking:
It sounds like your problem is a SQL one, and not a Notepad++ one??
and looked at the manual, but it is so freaking confusing and I don’t understand it.
The Notepad++ manual?
If so then :-( because the manual is very good and getting better all the time. -
@Alan-Kilborn I’m trying to go thru some sql code and mark these instances to copy to another document to reference table columns that are being used in our application. So far I haven’t been successful in using Notepad’s search feature. I don’t think it’s a sql problem, but a problem with understanding the search syntax.
-
Ah, I see it now; sorry.
How about searching in Regular expression search mode for
a\.(bfy|func_cd)
?Maybe add a
\b
at the start so that you don’t matchaa.bfy
ortesta.func_cd
?
So:\ba\.(bfy|func_cd)
Or even another
\b
at the end for a similar reason? -
@Alan-Kilborn Thank you that worked somewhat, I need the portion between ( ) to reference any column that might be contained in that code. That would be where the wildcard comes in. The table could have anywhere from 2 to 100 different columns.
-
@Sherry-Porras said in Searching and Marking:
wildcard
Well you have to define to yourself and to us what that “wildcard” is.
If it is just “word characters” (a-z, 0-9, and underscore) then you can use\w+
in the expression for it, possibly:a\.\w+
There’s great stuff in the user manual section for it on this, BTW. :-)
Also, HERE. -
@Alan-Kilborn Thank you, thank you that worked. I’ve been looking at https://npp-user-manual.org/docs/searching/#regular-expressions and found only one mention of using “w+” , like I said all the information is confusing and probably 98% of it I’ll never need or use, but I will make note of the links. Thank you for your assistance I so appreciate it.