Search with wildcard in multiples fields

Nalder, Jay JNalder at ascprofiles.com
Thu Mar 5 11:07:27 CST 2009


One more stab at this issue.
Given:

-          A file (named BLOCK) contains lines of text (named LINE-1, LINE-2, LINE-3 etc.).

-          You want to search for TEXT and return records in BLOCK when TEXT appears in any of the LINES.

Try this:
cancel clear
screen comments

temporary search-text char*30
file block primary occurs 10
access sequential request search-text
select if matchpattern( line-1, truncate(search-text)) or &
          matchpattern( line-2, truncate(search-text)) or &
          matchpattern( line-3, truncate(search-text)) or &
          matchpattern( line-4, truncate(search-text))

hilite data inverse

field search-text label "Search Word"

align (1,,4) (,,23) (,,42) (,,61)
cluster occurs with block
field line-1 size 18
field line-2 size 18
field line-3 size 18
field line-4 size 18

build

My preliminary test shows that the MATCHPATTERN function may be the key.

Jay Nalder.

________________________________


NOTICE - This message and any attached files may contain information that is confidential, legally privileged or proprietary. It is intended only for use by the intended recipient. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, be advised that you have received this message in error. Any dissemination, copying, use or re-transmission of this message or attachment, or the disclosure of any information therein, is strictly forbidden. BlueScope Steel Limited does not represent or guarantee that this message or attachment is free of errors, virus or interference.

If you have received this message in error please notify the sender immediately and delete the message. Any views expressed in this email are not necessarily the views of BlueScope Steel Limited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20090305/f7094f17/attachment.htm 


More information about the powerh-l mailing list