• Login
Community
  • Login

Data search, in text with columns

Scheduled Pinned Locked Moved General Discussion
5 Posts 2 Posters 1.1k 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.
  • F
    Francisco
    last edited by May 19, 2022, 12:15 AM

    HI Friends, In this file, with hundreds of rows, I have some data, organized in columns. The data, “59 AFA” are present in several rows, in columns 44 to 51 and 68 to 75. How can I do a search of “59 AFA”, contained only in columns 44 to 51?

    With this search, “(?-is)\b59.\b.\bAFA\b” I find all “59 AFA” data, but I only need the row references 44 a 51.

    AB: 3743 WW 20SS-13-21 0214 PF9XXX 59 SP RA5AA 59 HQ
    AB: 3720 WW 20SS-13-21 0219 PF9XXX 59 SP RA2OXB 59 SP
    AB: 3720 WW 20SS-13-21 0220 PF9XXX 59 AFA RA2AE 59 SP
    AB: 3716 WW 20SS-13-21 0220 PF9XXX 59 SP RA5BOM 59 SC
    AB: 3708 WW 20SS-13-21 0221 PF9XXX 59 AFA TR2RIC 59 AFA
    AB: 3720 WW 20SS-13-21 0223 PF9XXX 59 SP TR3VV 59 RS

    T 1 Reply Last reply May 19, 2022, 12:44 AM Reply Quote 0
    • T
      Terry R @Francisco
      last edited by May 19, 2022, 12:44 AM

      @francisco said in Data search, in text with columns:

      With this search, “(?-is)\b59.\b.\bAFA\b” I find all “59 AFA” data, but I only need the row references 44 a 51.

      I’m not sure if your post was “edited” by the system but your search pattern doesn’t work (for me).

      But this find pattern should work for the columns you need. As I’m not sure on exactly what you need, it may be that you need to incorporate it into something else, or edit it slightly, but as is, it can be used to find lines containing the text in the column range.
      Find What:^.{43,50}59 AFA

      Note that I used columns 43 to 50, so that means the 59 AFA starts on columns 44 through to 51. It may be that 51 is the end point of the string 59 AFA rather than the starting point. So consider that when using my regular expression.

      Terry

      F 2 Replies Last reply May 19, 2022, 1:39 AM Reply Quote 1
      • F
        Francisco @Terry R
        last edited by May 19, 2022, 1:39 AM

        @terry-r said in Data search, in text with columns:

        “(?-is)\b59.\b.\bAFA\b

        Terry, my post has been “edited” by the system, please replace the letter X with *

        (?-is)\b59.X\b.X\bAFA\b

        T 1 Reply Last reply May 19, 2022, 2:29 AM Reply Quote 0
        • F
          Francisco @Terry R
          last edited by May 19, 2022, 1:52 AM

          @terry-r Terry, your suggestion worked, I just needed to add 3 spaces between 59 and AFA, as it is in the file. Thank you very much
          Find what:^.{43,50}59 AFA

          1 Reply Last reply Reply Quote 1
          • T
            Terry R @Francisco
            last edited by May 19, 2022, 2:29 AM

            @francisco said in Data search, in text with columns:

            Terry, my post has been “edited” by the system,

            I thought as much. The system will adjust posts according to it’s “formatting rules”. To prevent these issues please read the post pinned at the start of this section of the forum titled “Please Read This Before Posting”. It outlines what is needed when posting examples. So if you happen to post again it is VERY important you follow those examples, otherwise you may find (again) the solution doesn’t fit your needs.

            It’s good to know that in this instance you were easily able to adjust to fit your requirements.

            Terry

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