Data search, in text with columns
-
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 -
@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
-
@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
-
@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 -
@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