• Login
Community
  • Login

Searching and Marking

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 2 Posters 404 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    Sherry Porras
    last edited by Jun 12, 2024, 2:38 PM

    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.

    A 1 Reply Last reply Jun 12, 2024, 2:49 PM Reply Quote 1
    • A
      Alan Kilborn @Sherry Porras
      last edited by Jun 12, 2024, 2:49 PM

      @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.

      S 1 Reply Last reply Jun 12, 2024, 2:58 PM Reply Quote 1
      • S
        Sherry Porras @Alan Kilborn
        last edited by Jun 12, 2024, 2:58 PM

        @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.

        A 1 Reply Last reply Jun 12, 2024, 3:11 PM Reply Quote 1
        • A
          Alan Kilborn @Sherry Porras
          last edited by Alan Kilborn Jun 12, 2024, 3:13 PM Jun 12, 2024, 3:11 PM

          @Sherry-Porras

          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 match aa.bfy or testa.func_cd?
          So: \ba\.(bfy|func_cd)

          Or even another \b at the end for a similar reason?

          S 1 Reply Last reply Jun 12, 2024, 3:18 PM Reply Quote 0
          • S
            Sherry Porras @Alan Kilborn
            last edited by Jun 12, 2024, 3:18 PM

            @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.

            A 1 Reply Last reply Jun 12, 2024, 4:02 PM Reply Quote 0
            • A
              Alan Kilborn @Sherry Porras
              last edited by Jun 12, 2024, 4:02 PM

              @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.

              S 1 Reply Last reply Jun 12, 2024, 4:16 PM Reply Quote 0
              • S
                Sherry Porras @Alan Kilborn
                last edited by Jun 12, 2024, 4:16 PM

                @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.

                1 Reply Last reply Reply Quote 1
                7 out of 7
                • First post
                  7/7
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors