Using findInFiles i am trying to find all instances of a specific string regardless of some characters. Here is an example line
IF INVENTORY.REC(III+14)<1,PURCHASE.ORDERS.WHSE.NO>=0 THEN INVENTORY.REC(III+14)<1,PURCHASE.ORDERS.WHSE.NO>=""
I have found all lines with INVENTORY.REC( using the string 'INVENTORY(" but i would like to find all lines with assignements so something like
INVENTORY.REC(?)<?>=
where i want to ignore any characters where the ? is
I would also like to know if there is any way to ignore all spaces. so lines like
IF INVENTORY.REC(III+14)<1,PURCHASE.ORDERS.WHSE.NO>=0
might be
IF INVENTORY.REC(III+14)<1,PURCHASE.ORDERS.WHSE.NO> = 0
wildcard characters
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
You need to use regular expressions, in which certain characters have special meanings:
“.� (dot) matches any single character except newline.
“.*� matches any number of characters except newline.
“ *� (there's a space in front of the “*�) matches any number of spaces.
When you want one of the special characters to represent itself you must quote it with a backslash. In particular, when using Posix syntax (see below), “.�, “(� and “)� must be quoted when they represent themselves.
So this might be what you need:
“.� (dot) matches any single character except newline.
“.*� matches any number of characters except newline.
“ *� (there's a space in front of the “*�) matches any number of spaces.
When you want one of the special characters to represent itself you must quote it with a backslash. In particular, when using Posix syntax (see below), “.�, “(� and “)� must be quoted when they represent themselves.
So this might be what you need:
This assumes you are using Posix regular expression syntax:Find what: INVENTORY\.REC\(.*\)<.*> *= *
[X] Regular expression
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
I find the following line appears in the results list. No where is there an INVENTORY.REC()<>=ben_josephs wrote:You need to use regular expressions, in which certain characters have special meanings:
“.� (dot) matches any single character except newline.
“.*� matches any number of characters except newline.
“ *� (there's a space in front of the “*�) matches any number of spaces.
When you want one of the special characters to represent itself you must quote it with a backslash. In particular, when using Posix syntax (see below), “.�, “(� and “)� must be quoted when they represent themselves.
So this might be what you need:This assumes you are using Posix regular expression syntax:Find what: INVENTORY\.REC\(.*\)<.*> *= *
[X] Regular expressionConfigure | Preferences | Editor
[X] Use POSIX regular expression syntax
WL.UPDATE.LOCATION.PIK(193): IF INVENTORY.SIZE.TYPE=99 OR (INVENTORY.REC(III+4)<1,WHSE.NO>+0)#0 OR INVENTORY.LOCS.REC(III)<1,1>#"" OR INVENTORY.LOCS.REC(III)<1,2>#"" OR INVENTORY.LOCS.REC(III)<1,3>#"" OR INVENTORY.LOCS.REC(III)<1,4>#"" THEN INVENTORY.STOCKED<1,WHSE.NO>=1;III=5
mostly works and is a great first step. thanks
what is the difference with postix ? (if it is quick
Last edited by Dtsig on Wed Jan 10, 2007 10:13 pm, edited 1 time in total.
DTSig
David Tod Sigafoos
David Tod Sigafoos
so what you are saying is that if i was in a specific record and did that selection it would select all rows from INVENTORY to the second =SteveH wrote:You also need to be aware that TextPad will find the longest match possible on each line. This means that using the example you gave ben_josephs search expression will match from the first INVENTORY to the second =.
Is this right?
DTSig
David Tod Sigafoos
David Tod Sigafoos
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Do you mean that there is to be no > between the < and the > ? You didn't make that clear. This imposes that restriction:Dtsig wrote:I find the following line appears in the results list. No where is there an INVENTORY.REC()<>=
INVENTORY\.REC\(.*\)<[^>]*> *= *
What other restrictions do you want to impose?
Search in TextPad's help for Posix.Dtsig wrote:what is the difference with postix ?
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
No. It will only match text on a single line. The search expression must include explicit newlines (\n) for TextPad to match text on more than one line. But, once it's found a position within a line at which there is a match, it will match the longest possible string that starts at that position. This is related to the fact that my original suggestion matched too much. If that's what Steve meant, I apologise for missing his point.Dtsig wrote:so what you are saying is that if i was in a specific record and did that selection it would select all rows from INVENTORY to the second =SteveH wrote:You also need to be aware that TextPad will find the longest match possible on each line. This means that using the example you gave ben_josephs search expression will match from the first INVENTORY to the second =.
Is this right?