cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

17-Peridot

## SELECTING PATTERN OF NUMBERS

Lets say I had a column of numbers (5 digits)

71053

71187

12378

72678

My required function was

f(7,1,’x’,”x”,”x”) =710537 and 71187

f(“x”,2,”x”,”x”,”x”)=12378 and 72678

f(“x”,x,”x”,”x”,”8”)=12378 and 72678

f(“x”,x,”6”,”x”,”8”)= 72678

etc

What would be the best approach ?

1 ACCEPTED SOLUTION

Accepted Solutions
20-Turquoise
(To:ppal)

Step 1 Separate data for each digit.

Step 2 Check the condition.

2 REPLIES 2
20-Turquoise
(To:ppal)

Step 1 Separate data for each digit.

Step 2 Check the condition.

24-Ruby V
(To:ppal)

Here is different approach.

The filter mask is provided as one single string, so there is no limit on number of digits in the data numbers or size of filter mask. To keep it all self-contained I found it better to provide the data vector as a second argument to the function.

The function assumes leading zeros for the numbers and treats any non-numeric character in the mask string as a wildcard (meaning "any digit").

P6 worksheet attached

Announcements
Top Tags