• Login
Community
  • Login

How do I create and expression to seach for end of line that does not have /001"

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 511 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.
  • T
    Talbot Teboe
    last edited by Mar 26, 2024, 11:06 PM

    Fellow Notepad++ Users,

    Could you please help me the the following search-and-replace problem I am having?

    DESCRIBE CIRCUMSTANCES OF YOUR QUESTION
    using the line that contains @DB/ as a starting point
    I would like to locate any line with the @DB/ that does NOT have /001" at the end

    Here is the data I currently have (“before” data):
    &LOG Part_Description: “”
    &LOG Associated_Files_Directory: “”
    &LOG Part: “PN1204-10-00A-prt489.prt”
    &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/PN1204-10-00A-prt489/001”
    &LOG Container: “”
    &LOG Part_Type: “”
    &LOG Part_Name: “”
    &LOG Part_Description: “”
    &LOG Associated_Files_Directory: “”
    &LOG Part: “PN1204-10-00A-prt49.prt”
    &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/PN1204-10-00A-prt49/001”
    &LOG Container: “”
    &LOG Part_Type: “”
    &LOG Part_Name: “”
    &LOG Part_Description: “”
    &LOG Associated_Files_Directory: “”
    &LOG Part: “PN1204-10-00A-prt490.prt”
    &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/PN1204-10-00A-prt490/001”
    &LOG Container: “”
    &LOG Part_Type: “”
    &LOG Part_Name: “”
    &LOG Part_Description: “”
    &LOG Associated_Files_Directory: “”
    &LOG Part: “PN1204-10-00A-prt491.prt”
    &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/PN1204-10-00A-prt491/001”
    &LOG Container: “”
    &LOG Part_Type: “”
    &LOG Part_Name: “”
    &LOG Part_Description: “”
    &LOG Associated_Files_Directory: “”
    &LOG Part: “FANUC_R-30IB_IPENDANT_stp.prt”
    &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/FANUC_R-30IB_IPENDANT_stp/001”
    &LOG Container: “”
    &LOG Part_Type: “”
    &LOG Part_Name: “”
    &LOG Part_Description: “”
    &LOG Associated_Files_Directory: “”
    &LOG Part: “FASCE-00-31-AVV._F177.8-0033790.prt”
    &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/FASCE-00-31-AVV./F177.8-0033790/001”
    &LOG Container: “”
    &LOG Part_Type: “”
    &LOG Part_Name: “”
    &LOG Part_Description: “”
    &LOG Associated_Files_Directory: “”
    &LOG Part: “FASCE-00-31-AVV._F177.8-0045181.prt”
    &LOG Naming_Technique: AUTO_GENERATE Clone_Name: @DB/157465/001
    &LOG Container: “”
    &LOG Part_Type: “”
    &LOG Part_Name: “”
    &LOG Part_Description: “”
    &LOG Associated_Files_Directory: “”
    &LOG Part: “FASCE-08-SV-AVV._SV-177.827547.prt”
    &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/FASCE-08-SV-AVV./SV-177.827547/001”
    Thanks for any assistance

    M T 2 Replies Last reply Mar 26, 2024, 11:58 PM Reply Quote 0
    • M
      Mark Olson @Talbot Teboe
      last edited by Mark Olson Mar 27, 2024, 1:43 AM Mar 26, 2024, 11:58 PM

      @Talbot-Teboe
      Please read this FAQ before asking future questions. That will help us help you.

      I also notice that you gave us example data that includes non-matches, but no matches. Every single line in your example that contains @DB also contains /001". Again, that information would have helped us help you.

      In any case, the regular expression (?-si)(?=.+@DB.*)(?!.*/001"$).* will match every line that contains @DB and does not end with /001".

      In the below example, only lines (3, 9, and 12) would match.

      &LOG Part_Description: ""
      &LOG Associated_Files_Directory: ""
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/ THIS WILL MATCH 1"
      &LOG Part: "PN1204-10-00A-prt489.prt"
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB THIS WILL NOT MATCH 1/001"
      &LOG Container: ""
      &LOG Part_Type: ""
      &LOG Part_Name: ""
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/ THIS WILL MATCH 2"
      &LOG Container: ""
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/THIS WILL NOT MATCH 2/001"
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/THIS WILL MATCH 3"
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/THIS WILL NOT MATCH 3/001"
      &LOG FJKRERJKJREKJREKJREKRJEKO: ""
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/THIS WILL NOT MATCH 4/001"
      
      1 Reply Last reply Reply Quote 4
      • T
        Talbot Teboe @Talbot Teboe
        last edited by Mar 27, 2024, 12:50 PM

        @Talbot-Teboe
        Sorry I didn’t realize that I needed to include lines without the /001
        In my attempt to create the expression I was not even close. I didn’t even get the last group of the expression correct
        I’d been manually searching for the lines without the /001, and had been at it for 3 hours before contacting the Community.
        Thank you very much for the assistance

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